================
@@ -945,3 +951,18 @@ void X86FlagsCopyLoweringPass::rewriteMI(MachineBasicBlock
&MBB,
MI.findRegisterUseOperand(X86::EFLAGS, /*TRI=*/nullptr)->setIsKill(true);
LLVM_DEBUG(dbgs() << " fixed instruction: "; MI.dump());
}
+
+bool X86FlagsCopyLoweringLegacy::runOnMachineFunction(MachineFunction &MF) {
+ auto *MDTWrapper = getAnalysisIfAvailable<MachineDominatorTreeWrapperPass>();
+ MachineDominatorTree *MDT = MDTWrapper ? &MDTWrapper->getDomTree() : nullptr;
+ return X86FlagsCopyLoweringImpl(MDT).runOnMachineFunction(MF);
+}
+
+PreservedAnalyses
+X86FlagsCopyLoweringPass::run(MachineFunction &MF,
+ MachineFunctionAnalysisManager &MFAM) {
+ MachineDominatorTree *MDT =
&MFAM.getResult<MachineDominatorTreeAnalysis>(MF);
----------------
aengelke wrote:
> so OwnedMDT is redundant for new pass manager version and using getResult is
> acceptable.
Only if getResult would be called in the middle of runOnMachineFunction, which
is difficult to implement when supporting legacy and new pass manager at the
same time.
https://github.com/llvm/llvm-project/pull/173752
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits