1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

Fix a silly mistake (which trips over an assertion) in r132099. rdar://9515076

llvm-svn: 132194
This commit is contained in:
Eli Friedman 2011-05-27 18:02:04 +00:00
parent 62a7038a9f
commit 560532051b
3 changed files with 17 additions and 9 deletions

View File

@ -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:

View File

@ -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; ) {

View File

@ -0,0 +1,9 @@
; RUN: llc < %s -O0 -mtriple=thumbv7-apple-darwin
; rdar://9515076
; (Make sure this doesn't crash.)
define i32 @test(i32 %i) {
%t = trunc i32 %1 to i4
%r = sext i4 %t to i32
ret i32 %r
}