diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-05-27 18:02:04 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-05-27 18:02:04 +0000 |
commit | fe84bd659cfb5432b7be77ede5809ccb16709581 (patch) | |
tree | 35229403212f986ecca89f807027927a3040a2ca /llvm/lib | |
parent | 3c6aed2d98f0213cd52ca90df40dd74ceb0302a8 (diff) | |
download | bcm5719-llvm-fe84bd659cfb5432b7be77ede5809ccb16709581.tar.gz bcm5719-llvm-fe84bd659cfb5432b7be77ede5809ccb16709581.zip |
Fix a silly mistake (which trips over an assertion) in r132099. rdar://9515076
llvm-svn: 132194
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/ARM/ARMFastISel.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Transforms/Scalar/LICM.cpp | 15 |
2 files changed, 8 insertions, 9 deletions
diff --git a/llvm/lib/Target/ARM/ARMFastISel.cpp b/llvm/lib/Target/ARM/ARMFastISel.cpp index 2d2ac670b01..fc0b8d23c71 100644 --- a/llvm/lib/Target/ARM/ARMFastISel.cpp +++ b/llvm/lib/Target/ARM/ARMFastISel.cpp @@ -1981,6 +1981,8 @@ bool ARMFastISel::SelectIntCast(const Instruction *I) { unsigned Opc; bool isZext = isa<ZExtInst>(I); bool isBoolZext = false; + if (!SrcVT.isSimple()) + return false; switch (SrcVT.getSimpleVT().SimpleTy) { default: return false; case MVT::i16: diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp index d42d4ff837b..935cd5d1ee4 100644 --- a/llvm/lib/Transforms/Scalar/LICM.cpp +++ b/llvm/lib/Transforms/Scalar/LICM.cpp @@ -372,7 +372,11 @@ bool LICM::canSinkOrHoistInst(Instruction &I) { return !pointerInvalidatedByLoop(LI->getOperand(0), Size, LI->getMetadata(LLVMContext::MD_tbaa)); } else if (CallInst *CI = dyn_cast<CallInst>(&I)) { - // Handle obvious cases efficiently. + // Don't sink or hoist dbg info; it's legal, but not useful. + if (isa<DbgInfoIntrinsic>(I)) + return false; + + // Handle simple cases by querying alias analysis. AliasAnalysis::ModRefBehavior Behavior = AA->getModRefBehavior(CI); if (Behavior == AliasAnalysis::DoesNotAccessMemory) return true; @@ -522,14 +526,7 @@ void LICM::sink(Instruction &I) { SSA.AddAvailableValue(ExitBlock, New); } - // If the instruction doesn't dominate any exit blocks, it must be dead. - if (NumInserted == 0) { - CurAST->deleteValue(&I); - if (!I.use_empty()) - I.replaceAllUsesWith(UndefValue::get(I.getType())); - I.eraseFromParent(); - return; - } + assert(NumInserted && "We shouldn't see dead instructions here!"); // Next, rewrite uses of the instruction, inserting PHI nodes as needed. for (Value::use_iterator UI = I.use_begin(), UE = I.use_end(); UI != UE; ) { |