@@ -1952,7 +1952,7 @@ SDValue SelectionDAGBuilder::getValueImpl(const Value *V) {
19521952 return DAG.getMDNode (cast<MDNode>(MD->getMetadata ()));
19531953
19541954 if (const auto *BB = dyn_cast<BasicBlock>(V))
1955- return DAG.getBasicBlock (FuncInfo.MBBMap [BB] );
1955+ return DAG.getBasicBlock (FuncInfo.getMBB (BB) );
19561956
19571957 llvm_unreachable (" Can't get register for value!" );
19581958}
@@ -1972,7 +1972,7 @@ void SelectionDAGBuilder::visitCatchPad(const CatchPadInst &I) {
19721972
19731973void SelectionDAGBuilder::visitCatchRet (const CatchReturnInst &I) {
19741974 // Update machine-CFG edge.
1975- MachineBasicBlock *TargetMBB = FuncInfo.MBBMap [ I.getSuccessor ()] ;
1975+ MachineBasicBlock *TargetMBB = FuncInfo.getMBB ( I.getSuccessor ()) ;
19761976 FuncInfo.MBB ->addSuccessor (TargetMBB);
19771977 TargetMBB->setIsEHCatchretTarget (true );
19781978 DAG.getMachineFunction ().setHasEHCatchret (true );
@@ -2000,7 +2000,7 @@ void SelectionDAGBuilder::visitCatchRet(const CatchReturnInst &I) {
20002000 else
20012001 SuccessorColor = cast<Instruction>(ParentPad)->getParent ();
20022002 assert (SuccessorColor && " No parent funclet for catchret!" );
2003- MachineBasicBlock *SuccessorColorMBB = FuncInfo.MBBMap [ SuccessorColor] ;
2003+ MachineBasicBlock *SuccessorColorMBB = FuncInfo.getMBB ( SuccessorColor) ;
20042004 assert (SuccessorColorMBB && " No MBB for SuccessorColor!" );
20052005
20062006 // Create the terminator node.
@@ -2056,14 +2056,14 @@ static void findWasmUnwindDestinations(
20562056 const Instruction *Pad = EHPadBB->getFirstNonPHI ();
20572057 if (isa<CleanupPadInst>(Pad)) {
20582058 // Stop on cleanup pads.
2059- UnwindDests.emplace_back (FuncInfo.MBBMap [ EHPadBB] , Prob);
2059+ UnwindDests.emplace_back (FuncInfo.getMBB ( EHPadBB) , Prob);
20602060 UnwindDests.back ().first ->setIsEHScopeEntry ();
20612061 break ;
20622062 } else if (const auto *CatchSwitch = dyn_cast<CatchSwitchInst>(Pad)) {
20632063 // Add the catchpad handlers to the possible destinations. We don't
20642064 // continue to the unwind destination of the catchswitch for wasm.
20652065 for (const BasicBlock *CatchPadBB : CatchSwitch->handlers ()) {
2066- UnwindDests.emplace_back (FuncInfo.MBBMap [ CatchPadBB] , Prob);
2066+ UnwindDests.emplace_back (FuncInfo.getMBB ( CatchPadBB) , Prob);
20672067 UnwindDests.back ().first ->setIsEHScopeEntry ();
20682068 }
20692069 break ;
@@ -2105,19 +2105,19 @@ static void findUnwindDestinations(
21052105 BasicBlock *NewEHPadBB = nullptr ;
21062106 if (isa<LandingPadInst>(Pad)) {
21072107 // Stop on landingpads. They are not funclets.
2108- UnwindDests.emplace_back (FuncInfo.MBBMap [ EHPadBB] , Prob);
2108+ UnwindDests.emplace_back (FuncInfo.getMBB ( EHPadBB) , Prob);
21092109 break ;
21102110 } else if (isa<CleanupPadInst>(Pad)) {
21112111 // Stop on cleanup pads. Cleanups are always funclet entries for all known
21122112 // personalities.
2113- UnwindDests.emplace_back (FuncInfo.MBBMap [ EHPadBB] , Prob);
2113+ UnwindDests.emplace_back (FuncInfo.getMBB ( EHPadBB) , Prob);
21142114 UnwindDests.back ().first ->setIsEHScopeEntry ();
21152115 UnwindDests.back ().first ->setIsEHFuncletEntry ();
21162116 break ;
21172117 } else if (const auto *CatchSwitch = dyn_cast<CatchSwitchInst>(Pad)) {
21182118 // Add the catchpad handlers to the possible destinations.
21192119 for (const BasicBlock *CatchPadBB : CatchSwitch->handlers ()) {
2120- UnwindDests.emplace_back (FuncInfo.MBBMap [ CatchPadBB] , Prob);
2120+ UnwindDests.emplace_back (FuncInfo.getMBB ( CatchPadBB) , Prob);
21212121 // For MSVC++ and the CLR, catchblocks are funclets and need prologues.
21222122 if (IsMSVCCXX || IsCoreCLR)
21232123 UnwindDests.back ().first ->setIsEHFuncletEntry ();
@@ -2777,7 +2777,7 @@ void SelectionDAGBuilder::visitBr(const BranchInst &I) {
27772777 MachineBasicBlock *BrMBB = FuncInfo.MBB ;
27782778
27792779 // Update machine-CFG edges.
2780- MachineBasicBlock *Succ0MBB = FuncInfo.MBBMap [ I.getSuccessor (0 )] ;
2780+ MachineBasicBlock *Succ0MBB = FuncInfo.getMBB ( I.getSuccessor (0 )) ;
27812781
27822782 if (I.isUnconditional ()) {
27832783 // Update machine-CFG edges.
@@ -2799,7 +2799,7 @@ void SelectionDAGBuilder::visitBr(const BranchInst &I) {
27992799 // If this condition is one of the special cases we handle, do special stuff
28002800 // now.
28012801 const Value *CondVal = I.getCondition ();
2802- MachineBasicBlock *Succ1MBB = FuncInfo.MBBMap [ I.getSuccessor (1 )] ;
2802+ MachineBasicBlock *Succ1MBB = FuncInfo.getMBB ( I.getSuccessor (1 )) ;
28032803
28042804 // If this is a series of conditions that are or'd or and'd together, emit
28052805 // this as a sequence of branches instead of setcc's with and/or operations.
@@ -3317,9 +3317,9 @@ void SelectionDAGBuilder::visitInvoke(const InvokeInst &I) {
33173317
33183318 // Retrieve successors. Look through artificial IR level blocks like
33193319 // catchswitch for successors.
3320- MachineBasicBlock *Return = FuncInfo.MBBMap [ I.getSuccessor (0 )] ;
3320+ MachineBasicBlock *Return = FuncInfo.getMBB ( I.getSuccessor (0 )) ;
33213321 const BasicBlock *EHPadBB = I.getSuccessor (1 );
3322- MachineBasicBlock *EHPadMBB = FuncInfo.MBBMap [ EHPadBB] ;
3322+ MachineBasicBlock *EHPadMBB = FuncInfo.getMBB ( EHPadBB) ;
33233323
33243324 // Deopt and ptrauth bundles are lowered in helper functions, and we don't
33253325 // have to do anything here to lower funclet bundles.
@@ -3427,13 +3427,13 @@ void SelectionDAGBuilder::visitCallBr(const CallBrInst &I) {
34273427 // Retrieve successors.
34283428 SmallPtrSet<BasicBlock *, 8 > Dests;
34293429 Dests.insert (I.getDefaultDest ());
3430- MachineBasicBlock *Return = FuncInfo.MBBMap [ I.getDefaultDest ()] ;
3430+ MachineBasicBlock *Return = FuncInfo.getMBB ( I.getDefaultDest ()) ;
34313431
34323432 // Update successor info.
34333433 addSuccessorWithProb (CallBrMBB, Return, BranchProbability::getOne ());
34343434 for (unsigned i = 0 , e = I.getNumIndirectDests (); i < e; ++i) {
34353435 BasicBlock *Dest = I.getIndirectDest (i);
3436- MachineBasicBlock *Target = FuncInfo.MBBMap [ Dest] ;
3436+ MachineBasicBlock *Target = FuncInfo.getMBB ( Dest) ;
34373437 Target->setIsInlineAsmBrIndirectTarget ();
34383438 Target->setMachineBlockAddressTaken ();
34393439 Target->setLabelMustBeEmitted ();
@@ -3525,7 +3525,7 @@ void SelectionDAGBuilder::visitIndirectBr(const IndirectBrInst &I) {
35253525 if (!Inserted)
35263526 continue ;
35273527
3528- MachineBasicBlock *Succ = FuncInfo.MBBMap [BB] ;
3528+ MachineBasicBlock *Succ = FuncInfo.getMBB (BB) ;
35293529 addSuccessorWithProb (IndirectBrMBB, Succ);
35303530 }
35313531 IndirectBrMBB->normalizeSuccProbs ();
@@ -8628,7 +8628,7 @@ SDValue SelectionDAGBuilder::lowerStartEH(SDValue Chain,
86288628 unsigned CallSiteIndex = FuncInfo.getCurrentCallSite ();
86298629 if (CallSiteIndex) {
86308630 MF.setCallSiteBeginLabel (BeginLabel, CallSiteIndex);
8631- LPadToCallSiteMap[FuncInfo.MBBMap [ EHPadBB] ].push_back (CallSiteIndex);
8631+ LPadToCallSiteMap[FuncInfo.getMBB ( EHPadBB) ].push_back (CallSiteIndex);
86328632
86338633 // Now that the call site is handled, stop tracking it.
86348634 FuncInfo.setCurrentCallSite (0 );
@@ -8659,7 +8659,7 @@ SDValue SelectionDAGBuilder::lowerEndEH(SDValue Chain, const InvokeInst *II,
86598659 EHInfo->addIPToStateRange (II, BeginLabel, EndLabel);
86608660 } else if (!isScopedEHPersonality (Pers)) {
86618661 assert (EHPadBB);
8662- MF.addInvoke (FuncInfo.MBBMap [ EHPadBB] , BeginLabel, EndLabel);
8662+ MF.addInvoke (FuncInfo.getMBB ( EHPadBB) , BeginLabel, EndLabel);
86638663 }
86648664
86658665 return Chain;
@@ -11826,7 +11826,7 @@ SelectionDAGBuilder::HandlePHINodesInSuccessorBlocks(const BasicBlock *LLVMBB) {
1182611826 // block.
1182711827 for (const BasicBlock *SuccBB : successors (LLVMBB->getTerminator ())) {
1182811828 if (!isa<PHINode>(SuccBB->begin ())) continue ;
11829- MachineBasicBlock *SuccMBB = FuncInfo.MBBMap [ SuccBB] ;
11829+ MachineBasicBlock *SuccMBB = FuncInfo.getMBB ( SuccBB) ;
1183011830
1183111831 // If this terminator has multiple identical successors (common for
1183211832 // switches), only handle each succ once.
@@ -12306,15 +12306,15 @@ void SelectionDAGBuilder::visitSwitch(const SwitchInst &SI) {
1230612306 CaseClusterVector Clusters;
1230712307 Clusters.reserve (SI.getNumCases ());
1230812308 for (auto I : SI.cases ()) {
12309- MachineBasicBlock *Succ = FuncInfo.MBBMap [ I.getCaseSuccessor ()] ;
12309+ MachineBasicBlock *Succ = FuncInfo.getMBB ( I.getCaseSuccessor ()) ;
1231012310 const ConstantInt *CaseVal = I.getCaseValue ();
1231112311 BranchProbability Prob =
1231212312 BPI ? BPI->getEdgeProbability (SI.getParent (), I.getSuccessorIndex ())
1231312313 : BranchProbability (1 , SI.getNumCases () + 1 );
1231412314 Clusters.push_back (CaseCluster::range (CaseVal, CaseVal, Succ, Prob));
1231512315 }
1231612316
12317- MachineBasicBlock *DefaultMBB = FuncInfo.MBBMap [ SI.getDefaultDest ()] ;
12317+ MachineBasicBlock *DefaultMBB = FuncInfo.getMBB ( SI.getDefaultDest ()) ;
1231812318
1231912319 // Cluster adjacent cases with the same destination. We do this at all
1232012320 // optimization levels because it's cheap to do and will make codegen faster
@@ -12368,7 +12368,7 @@ void SelectionDAGBuilder::visitSwitch(const SwitchInst &SI) {
1236812368 // Scale the branchprobability for DefaultMBB if the peel occurs and
1236912369 // DefaultMBB is not replaced.
1237012370 if (PeeledCaseProb != BranchProbability::getZero () &&
12371- DefaultMBB == FuncInfo.MBBMap [ SI.getDefaultDest ()] )
12371+ DefaultMBB == FuncInfo.getMBB ( SI.getDefaultDest ()) )
1237212372 DefaultProb = scaleCaseProbality (DefaultProb, PeeledCaseProb);
1237312373 WorkList.push_back (
1237412374 {PeeledSwitchMBB, First, Last, nullptr , nullptr , DefaultProb});
0 commit comments