diff options
author | Victor Hernandez <vhernandez@apple.com> | 2010-01-22 19:05:05 +0000 |
---|---|---|
committer | Victor Hernandez <vhernandez@apple.com> | 2010-01-22 19:05:05 +0000 |
commit | 0bc465d8369a1aec57891ae7ac0038a8c3a4b4cf (patch) | |
tree | 0d7fd1a64b457729c98dd969ffd65df74aaf85d0 /lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp | |
parent | 55f4aca91dd2e9d7b200fdd8948935994e58df8a (diff) | |
download | external_llvm-0bc465d8369a1aec57891ae7ac0038a8c3a4b4cf.zip external_llvm-0bc465d8369a1aec57891ae7ac0038a8c3a4b4cf.tar.gz external_llvm-0bc465d8369a1aec57891ae7ac0038a8c3a4b4cf.tar.bz2 |
Keep ignoring pointer-to-pointer bitcasts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94194 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp')
-rw-r--r-- | lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp index 91219c4..ae728dd 100644 --- a/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp +++ b/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp @@ -406,8 +406,10 @@ Instruction *InstCombiner::visitStoreInst(StoreInst &SI) { for (unsigned ScanInsts = 6; BBI != SI.getParent()->begin() && ScanInsts; --ScanInsts) { --BBI; - // Don't count debug info directives, lest they affect codegen - if (isa<DbgInfoIntrinsic>(BBI)) { + // Don't count debug info directives, lest they affect codegen, + // and we skip pointer-to-pointer bitcasts, which are NOPs. + if (isa<DbgInfoIntrinsic>(BBI) || + (isa<BitCastInst>(BBI) && isa<PointerType>(BBI->getType()))) { ScanInsts++; continue; } @@ -476,7 +478,8 @@ Instruction *InstCombiner::visitStoreInst(StoreInst &SI) { BBI = &SI; do { ++BBI; - } while (isa<DbgInfoIntrinsic>(BBI)); + } while (isa<DbgInfoIntrinsic>(BBI) || + (isa<BitCastInst>(BBI) && isa<PointerType>(BBI->getType()))); if (BranchInst *BI = dyn_cast<BranchInst>(BBI)) if (BI->isUnconditional()) if (SimplifyStoreAtEndOfBlock(SI)) @@ -536,7 +539,8 @@ bool InstCombiner::SimplifyStoreAtEndOfBlock(StoreInst &SI) { if (OtherBr->isUnconditional()) { --BBI; // Skip over debugging info. - while (isa<DbgInfoIntrinsic>(BBI)) { + while (isa<DbgInfoIntrinsic>(BBI) || + (isa<BitCastInst>(BBI) && isa<PointerType>(BBI->getType()))) { if (BBI==OtherBB->begin()) return false; --BBI; |