diff options
author | Bill Wendling <isanbard@gmail.com> | 2011-10-10 18:27:30 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2011-10-10 18:27:30 +0000 |
commit | 47aac5104302121ba64975cd4b51e27ef621131e (patch) | |
tree | 37be4c78d09a7862fabe6d81c8053c6884f40c24 /llvm/lib/Target/ARM/ARMISelLowering.cpp | |
parent | 0de5720737f1d4a9399577cad470fc55b6059c52 (diff) | |
download | bcm5719-llvm-47aac5104302121ba64975cd4b51e27ef621131e.tar.gz bcm5719-llvm-47aac5104302121ba64975cd4b51e27ef621131e.zip |
Revert r141365. It was causing MultiSource/Benchmarks/MiBench/consumer-lame to
hang, and possibly SPEC/CINT2006/464_h264ref.
llvm-svn: 141560
Diffstat (limited to 'llvm/lib/Target/ARM/ARMISelLowering.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMISelLowering.cpp | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp index 0313f99908c..a50bf09b3d9 100644 --- a/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -6181,86 +6181,6 @@ ARMTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI, MI->eraseFromParent(); // The pseudo instruction is gone now. return BB; } - - case ARM::ABS: - case ARM::t2ABS: { - // To insert an ABS instruction, we have to insert the - // diamond control-flow pattern. The incoming instruction knows the - // source vreg to test against 0, the destination vreg to set, - // the condition code register to branch on, the - // true/false values to select between, and a branch opcode to use. - // It transforms - // V1 = ABS V0 - // into - // V2 = MOVS V0 - // BCC (branch to SinkBB if V0 >= 0) - // RSBBB: V3 = RSBri V2, 0 (compute ABS if V2 < 0) - // SinkBB: V1 = PHI(V2, V3) - const BasicBlock *LLVM_BB = BB->getBasicBlock(); - MachineFunction::iterator BBI = BB; - ++BBI; - MachineFunction *Fn = BB->getParent(); - MachineBasicBlock *RSBBB = Fn->CreateMachineBasicBlock(LLVM_BB); - MachineBasicBlock *SinkBB = Fn->CreateMachineBasicBlock(LLVM_BB); - Fn->insert(BBI, RSBBB); - Fn->insert(BBI, SinkBB); - - unsigned int ABSSrcReg = MI->getOperand(1).getReg(); - unsigned int ABSDstReg = MI->getOperand(0).getReg(); - bool isThumb2 = Subtarget->isThumb2(); - MachineRegisterInfo &MRI = Fn->getRegInfo(); - // In Thumb mode S must not be specified if source register is the SP or - // PC and if destination register is the SP, so restrict register class - unsigned NewMovDstReg = MRI.createVirtualRegister( - isThumb2 ? ARM::rGPRRegisterClass : ARM::GPRRegisterClass); - unsigned NewRsbDstReg = MRI.createVirtualRegister( - isThumb2 ? ARM::rGPRRegisterClass : ARM::GPRRegisterClass); - - // Transfer the remainder of BB and its successor edges to sinkMBB. - SinkBB->splice(SinkBB->begin(), BB, - llvm::next(MachineBasicBlock::iterator(MI)), - BB->end()); - SinkBB->transferSuccessorsAndUpdatePHIs(BB); - - BB->addSuccessor(RSBBB); - BB->addSuccessor(SinkBB); - - // fall through to SinkMBB - RSBBB->addSuccessor(SinkBB); - - // insert a movs at the end of BB - BuildMI(BB, dl, TII->get(isThumb2 ? ARM::t2MOVr : ARM::MOVr), - NewMovDstReg) - .addReg(ABSSrcReg, RegState::Kill) - .addImm((unsigned)ARMCC::AL).addReg(0) - .addReg(ARM::CPSR, RegState::Define); - - // insert a bcc with opposite CC to ARMCC::MI at the end of BB - BuildMI(BB, dl, - TII->get(isThumb2 ? ARM::t2Bcc : ARM::Bcc)).addMBB(SinkBB) - .addImm(ARMCC::getOppositeCondition(ARMCC::MI)).addReg(ARM::CPSR); - - // insert rsbri in RSBBB - // Note: BCC and rsbri will be converted into predicated rsbmi - // by if-conversion pass - BuildMI(*RSBBB, RSBBB->begin(), dl, - TII->get(isThumb2 ? ARM::t2RSBri : ARM::RSBri), NewRsbDstReg) - .addReg(NewMovDstReg, RegState::Kill) - .addImm(0).addImm((unsigned)ARMCC::AL).addReg(0).addReg(0); - - // insert PHI in SinkBB, - // reuse ABSDstReg to not change uses of ABS instruction - BuildMI(*SinkBB, SinkBB->begin(), dl, - TII->get(ARM::PHI), ABSDstReg) - .addReg(NewRsbDstReg).addMBB(RSBBB) - .addReg(NewMovDstReg).addMBB(BB); - - // remove ABS instruction - MI->eraseFromParent(); - - // return last added BB - return SinkBB; - } } } |