[llvm-branch-commits] [X86][NewPM] Consistently preserve IR analyses in MF passes (PR #173759)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sat Dec 27 22:22:03 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-x86

Author: Aiden Grossman (boomanaiden154)

<details>
<summary>Changes</summary>

These three passes were not. Update them to make them consistent with
the rest of the MF passes.


---
Full diff: https://github.com/llvm/llvm-project/pull/173759.diff


3 Files Affected:

- (modified) llvm/lib/Target/X86/X86AvoidTrailingCall.cpp (+1-3) 
- (modified) llvm/lib/Target/X86/X86DynAllocaExpander.cpp (+1-3) 
- (modified) llvm/lib/Target/X86/X86FloatingPoint.cpp (+1-3) 


``````````diff
diff --git a/llvm/lib/Target/X86/X86AvoidTrailingCall.cpp b/llvm/lib/Target/X86/X86AvoidTrailingCall.cpp
index ebd4284f0f37d..67003dcbcf1d2 100644
--- a/llvm/lib/Target/X86/X86AvoidTrailingCall.cpp
+++ b/llvm/lib/Target/X86/X86AvoidTrailingCall.cpp
@@ -149,7 +149,5 @@ X86AvoidTrailingCallPass::run(MachineFunction &MF,
   if (!Changed)
     return PreservedAnalyses::all();
 
-  PreservedAnalyses PA = PreservedAnalyses::none();
-  PA.preserveSet<CFGAnalyses>();
-  return PA;
+  return getMachineFunctionPassPreservedAnalyses().preserveSet<CFGAnalyses>();
 }
diff --git a/llvm/lib/Target/X86/X86DynAllocaExpander.cpp b/llvm/lib/Target/X86/X86DynAllocaExpander.cpp
index 10f46f71bbbbd..bb4301c11c270 100644
--- a/llvm/lib/Target/X86/X86DynAllocaExpander.cpp
+++ b/llvm/lib/Target/X86/X86DynAllocaExpander.cpp
@@ -319,7 +319,5 @@ X86DynAllocaExpanderPass::run(MachineFunction &MF,
   if (!Changed)
     return PreservedAnalyses::all();
 
-  PreservedAnalyses PA = PreservedAnalyses::none();
-  PA.preserveSet<CFGAnalyses>();
-  return PA;
+  return getMachineFunctionPassPreservedAnalyses().preserveSet<CFGAnalyses>();
 }
diff --git a/llvm/lib/Target/X86/X86FloatingPoint.cpp b/llvm/lib/Target/X86/X86FloatingPoint.cpp
index 6af2050d8b9d0..8b89058c31201 100644
--- a/llvm/lib/Target/X86/X86FloatingPoint.cpp
+++ b/llvm/lib/Target/X86/X86FloatingPoint.cpp
@@ -1847,7 +1847,5 @@ X86FPStackifierPass::run(MachineFunction &MF,
   bool Changed = Impl.run(MF, Bundles);
   if (!Changed)
     return PreservedAnalyses::all();
-  PreservedAnalyses PA = PreservedAnalyses::none();
-  PA.preserveSet<CFGAnalyses>();
-  return PA;
+  return getMachineFunctionPassPreservedAnalyses().preserveSet<CFGAnalyses>();
 }

``````````

</details>


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


More information about the llvm-branch-commits mailing list