diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/ARM/ARMFastISel.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/lib/Target/ARM/ARMFastISel.cpp b/lib/Target/ARM/ARMFastISel.cpp index 81ecdb5..51dbfc2 100644 --- a/lib/Target/ARM/ARMFastISel.cpp +++ b/lib/Target/ARM/ARMFastISel.cpp @@ -365,20 +365,18 @@ bool ARMFastISel::ARMLoadAlloca(const Instruction *I) { Value *Op0 = I->getOperand(0); // Verify it's an alloca. - const Instruction *Inst = dyn_cast<Instruction>(Op0); - if (!Inst || Inst->getOpcode() != Instruction::Alloca) return false; - - const AllocaInst *AI = cast<AllocaInst>(Op0); - DenseMap<const AllocaInst*, int>::iterator SI = - FuncInfo.StaticAllocaMap.find(AI); - - if (SI != FuncInfo.StaticAllocaMap.end()) { - unsigned ResultReg = createResultReg(FixedRC); - TII.loadRegFromStackSlot(*FuncInfo.MBB, *FuncInfo.InsertPt, - ResultReg, SI->second, FixedRC, - TM.getRegisterInfo()); - UpdateValueMap(I, ResultReg); - return true; + if (const AllocaInst *AI = dyn_cast<AllocaInst>(Op0)) { + DenseMap<const AllocaInst*, int>::iterator SI = + FuncInfo.StaticAllocaMap.find(AI); + + if (SI != FuncInfo.StaticAllocaMap.end()) { + unsigned ResultReg = createResultReg(FixedRC); + TII.loadRegFromStackSlot(*FuncInfo.MBB, *FuncInfo.InsertPt, + ResultReg, SI->second, FixedRC, + TM.getRegisterInfo()); + UpdateValueMap(I, ResultReg); + return true; + } } return false; |