@@ -509,7 +509,10 @@ void SelectionDAGISel::initializeAnalysisResults(
509509 FnVarLocs = &FAM.getResult <DebugAssignmentTrackingAnalysis>(Fn);
510510
511511 auto *UA = FAM.getCachedResult <UniformityInfoAnalysis>(Fn);
512- CurDAG->init (*MF, *ORE, MFAM, LibInfo, UA, PSI, BFI, FnVarLocs);
512+ MachineModuleInfo &MMI =
513+ MAMP.getCachedResult <MachineModuleAnalysis>(*Fn.getParent ())->getMMI ();
514+
515+ CurDAG->init (*MF, *ORE, MFAM, LibInfo, UA, PSI, BFI, MMI, FnVarLocs);
513516
514517 // Now get the optional analyzes if we want to.
515518 // This is based on the possibly changed OptLevel (after optnone is taken
@@ -562,7 +565,11 @@ void SelectionDAGISel::initializeAnalysisResults(MachineFunctionPass &MFP) {
562565 UniformityInfo *UA = nullptr ;
563566 if (auto *UAPass = MFP.getAnalysisIfAvailable <UniformityInfoWrapperPass>())
564567 UA = &UAPass->getUniformityInfo ();
565- CurDAG->init (*MF, *ORE, &MFP, LibInfo, UA, PSI, BFI, FnVarLocs);
568+
569+ MachineModuleInfo &MMI =
570+ MFP.getAnalysis <MachineModuleInfoWrapperPass>().getMMI ();
571+
572+ CurDAG->init (*MF, *ORE, &MFP, LibInfo, UA, PSI, BFI, MMI, FnVarLocs);
566573
567574 // Now get the optional analyzes if we want to.
568575 // This is based on the possibly changed OptLevel (after optnone is taken
@@ -796,7 +803,7 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) {
796803 }
797804
798805 // Determine if floating point is used for msvc
799- computeUsesMSVCFloatingPoint (TM.getTargetTriple (), Fn, MF ->getMMI ());
806+ computeUsesMSVCFloatingPoint (TM.getTargetTriple (), Fn, *CurDAG ->getMMI ());
800807
801808 // Release function-specific state. SDB and CurDAG are already cleared
802809 // at this point.
@@ -1443,7 +1450,6 @@ bool SelectionDAGISel::PrepareEHLandingPad() {
14431450
14441451// Mark and Report IPToState for each Block under IsEHa
14451452void SelectionDAGISel::reportIPToStateForBlocks (MachineFunction *MF) {
1446- MachineModuleInfo &MMI = MF->getMMI ();
14471453 llvm::WinEHFuncInfo *EHInfo = MF->getWinEHFuncInfo ();
14481454 if (!EHInfo)
14491455 return ;
@@ -1458,8 +1464,8 @@ void SelectionDAGISel::reportIPToStateForBlocks(MachineFunction *MF) {
14581464 continue ;
14591465
14601466 // Insert EH Labels
1461- MCSymbol *BeginLabel = MMI. getContext ().createTempSymbol ();
1462- MCSymbol *EndLabel = MMI. getContext ().createTempSymbol ();
1467+ MCSymbol *BeginLabel = MF-> getContext ().createTempSymbol ();
1468+ MCSymbol *EndLabel = MF-> getContext ().createTempSymbol ();
14631469 EHInfo->addIPToStateRange (State, BeginLabel, EndLabel);
14641470 BuildMI (MBB, MBBb, SDB->getCurDebugLoc (),
14651471 TII->get (TargetOpcode::EH_LABEL))
0 commit comments