[llvm] Revert "Reland "[AArch64][NPM] Chalk out the CodeGenPassBuilder for NPM (#128…" (PR #128819)

Akshat Oke via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 25 21:24:22 PST 2025


https://github.com/optimisan created https://github.com/llvm/llvm-project/pull/128819

Reverts llvm/llvm-project#128662

>From 6ea4e1e1415d4902c69670343205b5c44f51514a Mon Sep 17 00:00:00 2001
From: Akshat Oke <Akshat.Oke at amd.com>
Date: Wed, 26 Feb 2025 10:54:09 +0530
Subject: [PATCH] =?UTF-8?q?Revert=20"Reland=20"[AArch64][NPM]=20Chalk=20ou?=
 =?UTF-8?q?t=20the=20CodeGenPassBuilder=20for=20NPM=20(#128=E2=80=A6"?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This reverts commit e927cf6653a9df804ca0556d8a5985f86ed9147c.
---
 .../Target/AArch64/AArch64TargetMachine.cpp   | 32 -------------------
 .../lib/Target/AArch64/AArch64TargetMachine.h |  6 ----
 llvm/lib/Target/AArch64/CMakeLists.txt        |  1 -
 .../AArch64/machine-latecleanup-inlineasm.mir |  3 --
 4 files changed, 42 deletions(-)

diff --git a/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp b/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
index 7c8f101fa1538..d10a0c0a08f89 100644
--- a/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
+++ b/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
@@ -41,7 +41,6 @@
 #include "llvm/MC/MCTargetOptions.h"
 #include "llvm/MC/TargetRegistry.h"
 #include "llvm/Pass.h"
-#include "llvm/Passes/CodeGenPassBuilder.h"
 #include "llvm/Passes/PassBuilder.h"
 #include "llvm/Support/CodeGen.h"
 #include "llvm/Support/CommandLine.h"
@@ -563,39 +562,8 @@ class AArch64PassConfig : public TargetPassConfig {
   std::unique_ptr<CSEConfigBase> getCSEConfig() const override;
 };
 
-class AArch64CodeGenPassBuilder
-    : public CodeGenPassBuilder<AArch64CodeGenPassBuilder,
-                                AArch64TargetMachine> {
-  using Base =
-      CodeGenPassBuilder<AArch64CodeGenPassBuilder, AArch64TargetMachine>;
-
-public:
-  AArch64CodeGenPassBuilder(AArch64TargetMachine &TM,
-                            const CGPassBuilderOption &Opts,
-                            PassInstrumentationCallbacks *PIC)
-      : CodeGenPassBuilder(TM, Opts, PIC) {}
-  void addPreISel(AddIRPass &) const {
-    // TODO: Add pre-isel passes
-  }
-  void addAsmPrinter(AddMachinePass &addPass, CreateMCStreamer) const {
-    // TODO: Add asm printer passes
-  }
-  Error addInstSelector(AddMachinePass &) const {
-    // TODO: Add instruction selector passes
-    return Error::success();
-  }
-};
-
 } // end anonymous namespace
 
-Error AArch64TargetMachine::buildCodeGenPipeline(
-    ModulePassManager &MPM, raw_pwrite_stream &Out, raw_pwrite_stream *DwoOut,
-    CodeGenFileType FileType, const CGPassBuilderOption &Opts,
-    PassInstrumentationCallbacks *PIC) {
-  AArch64CodeGenPassBuilder Builder(*this, Opts, PIC);
-  return Builder.buildPipeline(MPM, Out, DwoOut, FileType);
-}
-
 void AArch64TargetMachine::registerPassBuilderCallbacks(PassBuilder &PB) {
 
   PB.registerLateLoopOptimizationsEPCallback(
diff --git a/llvm/lib/Target/AArch64/AArch64TargetMachine.h b/llvm/lib/Target/AArch64/AArch64TargetMachine.h
index 4fb4581c63547..f8ba41f215430 100644
--- a/llvm/lib/Target/AArch64/AArch64TargetMachine.h
+++ b/llvm/lib/Target/AArch64/AArch64TargetMachine.h
@@ -46,12 +46,6 @@ class AArch64TargetMachine : public CodeGenTargetMachineImpl {
   // Pass Pipeline Configuration
   TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
 
-  Error buildCodeGenPipeline(ModulePassManager &MPM, raw_pwrite_stream &Out,
-                             raw_pwrite_stream *DwoOut,
-                             CodeGenFileType FileType,
-                             const CGPassBuilderOption &Opts,
-                             PassInstrumentationCallbacks *PIC) override;
-
   void registerPassBuilderCallbacks(PassBuilder &PB) override;
 
   TargetTransformInfo getTargetTransformInfo(const Function &F) const override;
diff --git a/llvm/lib/Target/AArch64/CMakeLists.txt b/llvm/lib/Target/AArch64/CMakeLists.txt
index e7acc08f6f1eb..2300e479bc110 100644
--- a/llvm/lib/Target/AArch64/CMakeLists.txt
+++ b/llvm/lib/Target/AArch64/CMakeLists.txt
@@ -105,7 +105,6 @@ add_llvm_target(AArch64CodeGen
   Core
   GlobalISel
   MC
-  Passes
   Scalar
   SelectionDAG
   Support
diff --git a/llvm/test/CodeGen/AArch64/machine-latecleanup-inlineasm.mir b/llvm/test/CodeGen/AArch64/machine-latecleanup-inlineasm.mir
index 5ce0fca6cd179..9a8e5c6341bca 100644
--- a/llvm/test/CodeGen/AArch64/machine-latecleanup-inlineasm.mir
+++ b/llvm/test/CodeGen/AArch64/machine-latecleanup-inlineasm.mir
@@ -1,9 +1,6 @@
 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 2
 # RUN: llc -start-before=machine-latecleanup -stop-after=machine-latecleanup \
 # RUN:   -o - %s | FileCheck %s
-
-# RUN: llc -enable-new-pm -passes=machine-latecleanup \
-# RUN:   -o - %s | FileCheck %s
 --- |
   ; ModuleID = 'reduced5.ll'
   source_filename = "reduced5.ll"



More information about the llvm-commits mailing list