[llvm-branch-commits] [X86][NewPM] Port X86FlagsCopyLowering to NPM (PR #173752)
Aiden Grossman via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sun Dec 28 14:14:55 PST 2025
================
@@ -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);
----------------
boomanaiden154 wrote:
Thanks for catching that. Updated.
It looks like I saw that we were computing the MDT if it didn't already exist without reading the code above that skipped functions without flag copies.
https://github.com/llvm/llvm-project/pull/173752
More information about the llvm-branch-commits
mailing list