diff options
author | Victor Hernandez <vhernandez@apple.com> | 2010-01-21 23:08:36 +0000 |
---|---|---|
committer | Victor Hernandez <vhernandez@apple.com> | 2010-01-21 23:08:36 +0000 |
commit | ae4d949721e47fe7b47beea1a45cb3073eae6821 (patch) | |
tree | c2636632f4fce1f0e044639301dd97d6d38301ce /llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp | |
parent | 5f5abd598c8ef460a0158c7b273a5bb7067496fd (diff) | |
download | bcm5719-llvm-ae4d949721e47fe7b47beea1a45cb3073eae6821.tar.gz bcm5719-llvm-ae4d949721e47fe7b47beea1a45cb3073eae6821.zip |
DbgInfoIntrinsic no longer appear in an instruction's use list
llvm-svn: 94113
Diffstat (limited to 'llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp index baaa130df68..291d320636a 100644 --- a/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp +++ b/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp @@ -76,16 +76,9 @@ 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 (const BitCastInst *BC = dyn_cast<BitCastInst>(*UI)) { - // A bitcast that does not feed into debug info inhibits promotion. - if (!BC->hasOneUse() || !isa<DbgInfoIntrinsic>(*BC->use_begin())) - return false; - // If the only use is by debug info, this alloca will not exist in - // non-debug code, so don't try to promote; this ensures the same - // codegen with debug info. Otherwise, debug info should not - // inhibit promotion (but we must examine other uses). - if (AI->hasOneUse()) - return false; + } else if (isa<BitCastInst>(*UI)) { + // A bitcast inhibits promotion. + return false; } else { return false; } @@ -290,15 +283,7 @@ namespace { for (Value::use_iterator UI = AI->use_begin(), E = AI->use_end(); UI != E;) { Instruction *User = cast<Instruction>(*UI++); - if (BitCastInst *BC = dyn_cast<BitCastInst>(User)) { - // Remove any uses of this alloca in DbgInfoInstrinsics. - assert(BC->hasOneUse() && "Unexpected alloca uses!"); - DbgInfoIntrinsic *DI = cast<DbgInfoIntrinsic>(*BC->use_begin()); - DI->eraseFromParent(); - BC->eraseFromParent(); - continue; - } - + if (StoreInst *SI = dyn_cast<StoreInst>(User)) { // Remember the basic blocks which define new values for the alloca DefiningBlocks.push_back(SI->getParent()); |