[llvm] [X86] Avoid useless DomTree in flags copy lowering (PR #97628)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 3 15:14:36 PDT 2024


================
@@ -258,13 +258,38 @@ bool X86FlagsCopyLoweringPass::runOnMachineFunction(MachineFunction &MF) {
   MRI = &MF.getRegInfo();
   TII = Subtarget->getInstrInfo();
   TRI = Subtarget->getRegisterInfo();
-  MDT = &getAnalysis<MachineDominatorTreeWrapperPass>().getDomTree();
   PromoteRC = &X86::GR8RegClass;
 
   if (MF.empty())
     // Nothing to do for a degenerate empty function...
     return false;
 
+  bool HasCopies = false;
+  for (const MachineInstr &DefInst : MRI->def_instructions(X86::EFLAGS)) {
----------------
topperc wrote:

Can we use `llvm::none_of` with a lambda?

https://github.com/llvm/llvm-project/pull/97628


More information about the llvm-commits mailing list