[llvm] [CodeGen] Port AtomicExpand to new Pass Manager (PR #71220)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 5 02:27:31 PST 2024


================
@@ -340,7 +342,31 @@ bool AtomicExpand::runOnFunction(Function &F) {
   return MadeChange;
 }
 
-bool AtomicExpand::bracketInstWithFences(Instruction *I, AtomicOrdering Order) {
+bool AtomicExpandLegacy::runOnFunction(Function &F) {
+
+  auto *TM = &getAnalysis<TargetPassConfig>().getTM<TargetMachine>();
+
+  AtomicExpandImpl AE;
+  return AE.run(F, TM);
+}
+
+FunctionPass *llvm::createAtomicExpandLegacyPass() {
+  return new AtomicExpandLegacy();
+}
+
+PreservedAnalyses AtomicExpandPass::run(Function &F,
+                                        FunctionAnalysisManager &AM) {
+  AtomicExpandImpl AE;
+
+  bool Changed = AE.run(F, TM);
+  if (!Changed)
----------------
arsenm wrote:

could figure out if CFG changes were made, but that's a more complex change which should be done separately 

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


More information about the llvm-commits mailing list