llvm.org GIT mirror llvm / 5cbef19
Get the proper call site numbers for the landing pads. Also remove a magic number (18) for the proper addressing mode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141245 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 8 years ago
1 changed file(s) with 28 addition(s) and 16 deletion(s). Raw diff Collapse all Expand all
55975597 if (!II->isEHLabel()) continue;
55985598
55995599 MCSymbol *Sym = II->getOperand(0).getMCSymbol();
5600 if (!MMI.hasCallSiteBeginLabel(Sym)) continue;
5601
5602 unsigned CallSiteNum = MMI.getCallSiteBeginLabel(Sym);
5603 CallSiteNumToLPad[CallSiteNum].push_back(BB);
5604 MaxCSNum = std::max(MaxCSNum, CallSiteNum);
5600 if (!MMI.hasCallSiteLandingPad(Sym)) continue;
5601
5602 SmallVectorImpl &CallSiteIdxs = MMI.getCallSiteLandingPad(Sym);
5603 for (SmallVectorImpl::iterator
5604 CSI = CallSiteIdxs.begin(), CSE = CallSiteIdxs.end();
5605 CSI != CSE; ++CSI) {
5606 CallSiteNumToLPad[*CSI].push_back(BB);
5607 MaxCSNum = std::max(MaxCSNum, *CSI);
5608 }
56055609 break;
56065610 }
56075611 }
56155619 II = MBBList.begin(), IE = MBBList.end(); II != IE; ++II)
56165620 LPadList.push_back(*II);
56175621 }
5622
5623 assert(!LPadList.empty() &&
5624 "No landing pad destinations for the dispatch jump table!");
56185625
56195626 MachineJumpTableInfo *JTI =
56205627 MF->getOrCreateJumpTableInfo(MachineJumpTableInfo::EK_Inline);
56425649 .addReg(ARM::CPSR);
56435650
56445651 /*
5645 %vreg11 = t2LDRi12 , 4, pred:14, pred:%noreg; mem:Volatile LD4[%sunkaddr131] rGPR:%vreg11
5646 t2CMPri %vreg11, 6, pred:14, pred:%noreg, %CPSR; rGPR:%vreg11
5647 t2Bcc , pred:8, pred:%CPSR
5648 */
5649
5650 /*
5651 %vreg11 = t2LDRi12 , 4, pred:14, pred:%noreg; mem:Volatile LD4[%sunkaddr131] rGPR:%vreg11
5652 %vreg12 = t2LEApcrelJT , 0, pred:14, pred:%noreg; rGPR:%vreg12
5653 %vreg13 = t2ADDrs %vreg12, %vreg11, 18, pred:14, pred:%noreg, opt:%noreg; GPRnopc:%vreg13 rGPR:%vreg12,%vreg11
5654 t2BR_JT %vreg13, %vreg11, , 0; GPRnopc:%vreg13 rGPR:%vreg11
5652
5653 BB#32: derived from LLVM BB %eh.sjlj.setjmp.catch
5654 Predecessors according to CFG: BB#0
5655 %vreg11 = t2LDRi12 , 4, pred:14, pred:%noreg; mem:Volatile LD4[%sunkaddr131] rGPR:%vreg11
5656 t2CMPri %vreg11, 6, pred:14, pred:%noreg, %CPSR; rGPR:%vreg11
5657 t2Bcc , pred:8, pred:%CPSR
5658 Successors according to CFG: BB#33 BB#35
5659
5660 BB#35: derived from LLVM BB %eh.sjlj.setjmp.catch
5661 Predecessors according to CFG: BB#32
5662 %vreg12 = t2LEApcrelJT , 0, pred:14, pred:%noreg; rGPR:%vreg12
5663 %vreg13 = t2ADDrs %vreg12, %vreg11, 18, pred:14, pred:%noreg, opt:%noreg; GPRnopc:%vreg13 rGPR:%vreg12,%vreg11
5664 t2BR_JT %vreg13, %vreg11, , 0; GPRnopc:%vreg13 rGPR:%vreg11
5665 Successors according to CFG: BB#3 BB#28 BB#26 BB#24 BB#22 BB#20 BB#31
5666
56555667 */
56565668
56575669 FIMMO = MF->getMachineMemOperand(MachinePointerInfo::getFixedStack(FI),
56685680 BuildMI(DispContBB, dl, TII->get(ARM::t2ADDrs), NewVReg3)
56695681 .addReg(NewVReg2, RegState::Kill)
56705682 .addReg(NewVReg1)
5671 .addImm(18)));
5683 .addImm(ARM_AM::getSORegOpc(ARM_AM::lsl, 2))));
56725684
56735685 BuildMI(DispContBB, dl, TII->get(ARM::t2BR_JT))
56745686 .addReg(NewVReg3, RegState::Kill)