From: Victor Hernandez Date: Fri, 22 Jan 2010 19:05:05 +0000 (+0000) Subject: Keep ignoring pointer-to-pointer bitcasts X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=29fa5e98863332eb808a6f5c1e29138ca6fd7f5c;p=oota-llvm.git Keep ignoring pointer-to-pointer bitcasts git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94194 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp index 91219c45ad7..ae728ddecfd 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(BBI)) { + // Don't count debug info directives, lest they affect codegen, + // and we skip pointer-to-pointer bitcasts, which are NOPs. + if (isa(BBI) || + (isa(BBI) && isa(BBI->getType()))) { ScanInsts++; continue; } @@ -476,7 +478,8 @@ Instruction *InstCombiner::visitStoreInst(StoreInst &SI) { BBI = &SI; do { ++BBI; - } while (isa(BBI)); + } while (isa(BBI) || + (isa(BBI) && isa(BBI->getType()))); if (BranchInst *BI = dyn_cast(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(BBI)) { + while (isa(BBI) || + (isa(BBI) && isa(BBI->getType()))) { if (BBI==OtherBB->begin()) return false; --BBI; diff --git a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp index 291d320636a..9fdcfe5ec3d 100644 --- a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp +++ b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp @@ -76,9 +76,6 @@ bool llvm::isAllocaPromotable(const AllocaInst *AI) { return false; // Don't allow a store OF the AI, only INTO the AI. if (SI->isVolatile()) return false; - } else if (isa(*UI)) { - // A bitcast inhibits promotion. - return false; } else { return false; }