https://github.com/arsenm updated 
https://github.com/llvm/llvm-project/pull/222672

>From d37cbd4afaca7fe59a2c5511ecd6e2bea4bc3220 Mon Sep 17 00:00:00 2001
From: Matt Arsenault <[email protected]>
Date: Thu, 3 Sep 2026 00:49:57 +0200
Subject: [PATCH] CodeGen: Remove TargetOptions::EABIVersion

The field's only effect was gating the __aeabi_mem*[4|8] libcalls via the
IsEABI4/IsEABI5 predicates. That distinction is derivable from the triple's
environment, so replace the two predicates with a single
triple-derived IsEABIVersion and delete the field.

The clang -meabi option and clang::TargetOptions::EABIVersion are
retained (now codegen-inert); the llc/opt -meabi flag is removed. -meabi
now only takes effect on triples with a bare-EABI/GNU environment pair
(arm-none-eabi <-> gnueabi), which is the only case with a triple
representation.

Co-authored-by: Claude (Claude-Opus-4.8) <[email protected]>
---
 clang/lib/Basic/Targets/AArch64.cpp           |  6 +---
 clang/lib/Basic/Targets/ARM.cpp               |  5 +--
 clang/lib/CodeGen/BackendUtil.cpp             |  3 --
 clang/lib/Driver/ToolChain.cpp                |  1 +
 clang/lib/Driver/ToolChains/Arch/ARM.cpp      | 32 +++++++++++++++++++
 clang/lib/Driver/ToolChains/Arch/ARM.h        |  2 ++
 clang/lib/Driver/ToolChains/Clang.cpp         | 10 ++++--
 clang/test/CodeGen/arm-eabi.c                 |  6 ++--
 clang/test/Driver/eabi.c                      | 19 +++++++----
 flang/lib/Frontend/FrontendActions.cpp        |  7 ++--
 llvm/docs/ReleaseNotes.md                     |  4 +++
 .../llvm/Analysis/RuntimeLibcallInfo.h        |  7 ++--
 llvm/include/llvm/CodeGen/CommandFlags.h      |  2 --
 llvm/include/llvm/IR/RuntimeLibcalls.h        | 18 ++++-------
 llvm/include/llvm/IR/RuntimeLibcalls.td       |  8 +++--
 llvm/include/llvm/Target/TargetOptions.h      |  3 --
 llvm/lib/Analysis/RuntimeLibcallInfo.cpp      |  8 ++---
 llvm/lib/CodeGen/CodeGenTargetMachineImpl.cpp |  5 ++-
 llvm/lib/CodeGen/CommandFlags.cpp             | 12 -------
 llvm/lib/CodeGen/TargetLoweringBase.cpp       |  1 -
 llvm/lib/IR/RuntimeLibcalls.cpp               | 14 ++++----
 llvm/lib/LTO/LTOBackend.cpp                   |  4 +--
 llvm/lib/Passes/RunCodeGen.cpp                |  5 ++-
 llvm/lib/Target/ARM/ARMTargetMachine.cpp      | 17 ----------
 llvm/test/CodeGen/ARM/arm-eabi.ll             | 25 +++------------
 llvm/test/CodeGen/ARM/float-helpers.ll        |  8 ++---
 .../RuntimeLibcallEmitter-calling-conv.td     |  2 +-
 .../RuntimeLibcallEmitter-library-dispatch.td |  6 ++--
 .../RuntimeLibcallEmitter-library-grouping.td |  4 +--
 ...untimeLibcallEmitter-library-name-merge.td |  4 +--
 llvm/test/TableGen/RuntimeLibcallEmitter.td   |  2 +-
 .../codegen-opt-flags.ll                      |  2 +-
 llvm/tools/llc/lib/NewPMDriver.cpp            |  2 +-
 llvm/tools/llc/lib/llcdriver.cpp              |  6 ++--
 llvm/tools/opt/NewPMDriver.cpp                |  5 ++-
 llvm/tools/opt/optdriver.cpp                  | 10 +++---
 .../TableGen/Basic/RuntimeLibcallsEmitter.cpp |  8 ++---
 37 files changed, 128 insertions(+), 155 deletions(-)

diff --git a/clang/lib/Basic/Targets/AArch64.cpp 
b/clang/lib/Basic/Targets/AArch64.cpp
index 0f36f87806e43..a4841514be35e 100644
--- a/clang/lib/Basic/Targets/AArch64.cpp
+++ b/clang/lib/Basic/Targets/AArch64.cpp
@@ -204,11 +204,7 @@ AArch64TargetInfo::AArch64TargetInfo(const llvm::Triple 
&Triple,
   if (Triple.getOS() == llvm::Triple::Linux)
     this->MCountName = "\01_mcount";
   else if (Triple.getOS() == llvm::Triple::UnknownOS)
-    this->MCountName =
-        (Opts.EABIVersion == llvm::EABI::GNU ||
-         (Opts.EABIVersion == llvm::EABI::Default && 
Triple.isGNUEnvironment()))
-            ? "\01_mcount"
-            : "mcount";
+    this->MCountName = Triple.isGNUEnvironment() ? "\01_mcount" : "mcount";
 }
 
 StringRef AArch64TargetInfo::getABI() const { return ABI; }
diff --git a/clang/lib/Basic/Targets/ARM.cpp b/clang/lib/Basic/Targets/ARM.cpp
index 2df1837aa0621..0e424d031700b 100644
--- a/clang/lib/Basic/Targets/ARM.cpp
+++ b/clang/lib/Basic/Targets/ARM.cpp
@@ -326,10 +326,7 @@ ARMTargetInfo::ARMTargetInfo(const llvm::Triple &Triple,
   if (Triple.getOS() == llvm::Triple::Linux ||
       Triple.getOS() == llvm::Triple::UnknownOS)
     this->MCountName =
-        (Opts.EABIVersion == llvm::EABI::GNU ||
-         (Opts.EABIVersion == llvm::EABI::Default && 
Triple.isGNUEnvironment()))
-            ? "llvm.arm.gnu.eabi.mcount"
-            : "\01mcount";
+        Triple.isGNUEnvironment() ? "llvm.arm.gnu.eabi.mcount" : "\01mcount";
 
   SoftFloatABI = llvm::is_contained(Opts.FeaturesAsWritten, "+soft-float-abi");
 }
diff --git a/clang/lib/CodeGen/BackendUtil.cpp 
b/clang/lib/CodeGen/BackendUtil.cpp
index 9ee7e3e3b8f89..8bae40a96e6e4 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -385,9 +385,6 @@ static bool initTargetOptions(const CompilerInstance &CI,
   Options.UseInitArray = CodeGenOpts.UseInitArray;
   Options.MCOptions.DisableIntegratedAS = CodeGenOpts.DisableIntegratedAS;
 
-  // Set EABI version.
-  Options.EABIVersion = TargetOpts.EABIVersion;
-
   if (CodeGenOpts.hasSjLjExceptions())
     Options.ExceptionModel = llvm::ExceptionHandling::SjLj;
   if (CodeGenOpts.hasSEHExceptions())
diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp
index 4b194b5b70534..c1c3504d831b4 100644
--- a/clang/lib/Driver/ToolChain.cpp
+++ b/clang/lib/Driver/ToolChain.cpp
@@ -1533,6 +1533,7 @@ std::string ToolChain::ComputeLLVMTriple(const ArgList 
&Args, BoundArch BA,
     llvm::Triple Triple = getTriple();
     tools::arm::setArchNameInTriple(getDriver(), Args, InputType, Triple);
     tools::arm::setFloatABIInTriple(getDriver(), Args, Triple);
+    tools::arm::setEABIInTriple(getDriver(), Args, Triple);
     return Triple.getTriple();
   }
   }
diff --git a/clang/lib/Driver/ToolChains/Arch/ARM.cpp 
b/clang/lib/Driver/ToolChains/Arch/ARM.cpp
index 7d9c1f0bd3d40..f06483880358f 100644
--- a/clang/lib/Driver/ToolChains/Arch/ARM.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/ARM.cpp
@@ -400,6 +400,38 @@ void arm::setFloatABIInTriple(const Driver &D, const 
ArgList &Args,
   }
 }
 
+void arm::setEABIInTriple(const Driver &D, const ArgList &Args,
+                          llvm::Triple &Triple) {
+  Arg *A = Args.getLastArg(options::OPT_meabi);
+  if (!A)
+    return;
+
+  StringRef Value = A->getValue();
+  if (Value == "gnu") {
+    switch (Triple.getEnvironment()) {
+    case llvm::Triple::EABI:
+      Triple.setEnvironment(llvm::Triple::GNUEABI);
+      break;
+    case llvm::Triple::EABIHF:
+      Triple.setEnvironment(llvm::Triple::GNUEABIHF);
+      break;
+    default:
+      break;
+    }
+  } else if (Value == "4" || Value == "5") {
+    switch (Triple.getEnvironment()) {
+    case llvm::Triple::GNUEABI:
+      Triple.setEnvironment(llvm::Triple::EABI);
+      break;
+    case llvm::Triple::GNUEABIHF:
+      Triple.setEnvironment(llvm::Triple::EABIHF);
+      break;
+    default:
+      break;
+    }
+  }
+}
+
 arm::FloatABI arm::getARMFloatABI(const ToolChain &TC, const ArgList &Args) {
   return arm::getARMFloatABI(TC.getDriver(), TC.getEffectiveTriple(), Args);
 }
diff --git a/clang/lib/Driver/ToolChains/Arch/ARM.h 
b/clang/lib/Driver/ToolChains/Arch/ARM.h
index a23a8793a89e2..180db7612a488 100644
--- a/clang/lib/Driver/ToolChains/Arch/ARM.h
+++ b/clang/lib/Driver/ToolChains/Arch/ARM.h
@@ -56,6 +56,8 @@ FloatABI getARMFloatABI(const Driver &D, const llvm::Triple 
&Triple,
                         const llvm::opt::ArgList &Args);
 void setFloatABIInTriple(const Driver &D, const llvm::opt::ArgList &Args,
                          llvm::Triple &triple);
+void setEABIInTriple(const Driver &D, const llvm::opt::ArgList &Args,
+                     llvm::Triple &triple);
 bool isHardTPSupported(const llvm::Triple &Triple);
 ReadTPMode getReadTPMode(const Driver &D, const llvm::opt::ArgList &Args,
                          const llvm::Triple &Triple, bool ForAS);
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp 
b/clang/lib/Driver/ToolChains/Clang.cpp
index df6022c204425..6636a5fd6e655 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -1361,7 +1361,6 @@ namespace {
 void RenderARMABI(const Driver &D, const llvm::Triple &Triple,
                   const ArgList &Args, ArgStringList &CmdArgs) {
   // Select the ABI to use.
-  // FIXME: Support -meabi.
   // FIXME: Parts of this are duplicated in the backend, unify this somehow.
   const char *ABIName = nullptr;
   if (Arg *A = Args.getLastArg(options::OPT_mabi_EQ))
@@ -5960,9 +5959,14 @@ void Clang::ConstructJob(Compilation &C, const JobAction 
&JA,
       RelocationModel == llvm::Reloc::ROPI_RWPI)
     CmdArgs.push_back("-frwpi");
 
+  // -meabi=gnu/5 are encoded in the cc1 -triple environment; forward only 
other
+  // values (e.g. 4, which has no triple representation, and invalid values).
   if (Arg *A = Args.getLastArg(options::OPT_meabi)) {
-    CmdArgs.push_back("-meabi");
-    CmdArgs.push_back(A->getValue());
+    StringRef Value = A->getValue();
+    if (Value != "gnu" && Value != "5") {
+      CmdArgs.push_back("-meabi");
+      CmdArgs.push_back(A->getValue());
+    }
   }
 
   // -fsemantic-interposition is forwarded to CC1: set the
diff --git a/clang/test/CodeGen/arm-eabi.c b/clang/test/CodeGen/arm-eabi.c
index 3a651feafbccd..9653717926c0a 100644
--- a/clang/test/CodeGen/arm-eabi.c
+++ b/clang/test/CodeGen/arm-eabi.c
@@ -9,12 +9,10 @@
 // RUN: %clang -target arm-none-gnueabihf -S -meabi 5 -o - %s | FileCheck 
-check-prefix=CHECK-EABI %s
 // RUN: %clang -target arm-none-musleabi -S -o - %s \
 // RUN:   | FileCheck -check-prefix=CHECK-GNUEABI %s
-// RUN: %clang -target arm-none-musleabi -S -o - %s -meabi 5 \
-// RUN:   | FileCheck -check-prefix=CHECK-EABI %s
 // RUN: %clang -target arm-none-musleabihf -S -o - %s \
 // RUN:   | FileCheck -check-prefix=CHECK-GNUEABI %s
-// RUN: %clang -target arm-none-musleabihf -S -o - %s -meabi 5 \
-// RUN:   | FileCheck -check-prefix=CHECK-EABI %s
+
+// Musl has no bare-EABI triple environment, so -meabi=5 has no effect there.
 
 struct my_s {
   unsigned long a[18];
diff --git a/clang/test/Driver/eabi.c b/clang/test/Driver/eabi.c
index 4fd8ee8344e6c..c77fb76c4cc29 100644
--- a/clang/test/Driver/eabi.c
+++ b/clang/test/Driver/eabi.c
@@ -1,13 +1,20 @@
-// RUN: %clang %s -meabi 4 -### 2>&1 \
+// -meabi=4 has no triple environment, so it is forwarded to cc1.
+// RUN: %clang %s -target arm-none-eabi -meabi 4 -### 2>&1 \
 // RUN:   | FileCheck -check-prefix=CHECK-EABI4 %s
-// RUN: %clang %s -meabi 5 -### 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK-EABI5 %s
-// RUN: %clang %s -meabi gnu -### 2>&1 \
+
+// -meabi=gnu/5 are encoded in the cc1 -triple environment, not forwarded.
+// RUN: %clang %s -target arm-none-eabi -meabi gnu -### 2>&1 \
 // RUN:   | FileCheck -check-prefix=CHECK-GNUEABI %s
+// RUN: %clang %s -target arm-none-gnueabi -meabi 5 -### 2>&1 \
+// RUN:   | FileCheck -check-prefix=CHECK-EABI5 %s
+
 // RUN: not %clang %s -meabi unknown 2>&1 \
 // RUN:   | FileCheck -check-prefix=CHECK-UNKNOWN %s
 
+// CHECK-EABI4: "-triple" "armv{{.*}}-unknown-none-eabi"
 // CHECK-EABI4: "-meabi" "4"
-// CHECK-EABI5: "-meabi" "5"
-// CHECK-GNUEABI: "-meabi" "gnu"
+// CHECK-GNUEABI: "-triple" "armv{{.*}}-unknown-none-gnueabi"
+// CHECK-GNUEABI-NOT: "-meabi"
+// CHECK-EABI5: "-triple" "armv{{.*}}-unknown-none-eabi"
+// CHECK-EABI5-NOT: "-meabi"
 // CHECK-UNKNOWN: error: invalid value 'unknown' in '-meabi unknown'
diff --git a/flang/lib/Frontend/FrontendActions.cpp 
b/flang/lib/Frontend/FrontendActions.cpp
index 969485b029257..9da6b451bb2bd 100644
--- a/flang/lib/Frontend/FrontendActions.cpp
+++ b/flang/lib/Frontend/FrontendActions.cpp
@@ -1032,7 +1032,6 @@ void 
CodeGenAction::runOptimizationPipeline(llvm::raw_pwrite_stream &os) {
   mam.registerPass([&] {
     return llvm::RuntimeLibraryAnalysis(
         targetMachine->Options.ExceptionModel,
-        targetMachine->Options.EABIVersion,
         targetMachine->Options.MCOptions.ABIName,
         targetMachine->Options.VecLib);
   });
@@ -1083,9 +1082,9 @@ void 
CodeGenAction::runOptimizationPipeline(llvm::raw_pwrite_stream &os) {
             os, /*ShouldPreserveUseListOrder=*/false, emitSummary));
       }
     } else if (action == BackendActionTy::Backend_EmitLL) {
-      mpm.addPass(llvm::PrintModulePass(
-          os, /*Banner=*/"", /*ShouldPreserveUseListOrder=*/false, emitSummary,
-          /*ShouldRenumberMetadata=*/true));
+      mpm.addPass(llvm::PrintModulePass(os, /*Banner=*/"",
+                                        /*ShouldPreserveUseListOrder=*/false,
+                                        emitSummary));
     }
   }
 
diff --git a/llvm/docs/ReleaseNotes.md b/llvm/docs/ReleaseNotes.md
index 4acfcaf3204a7..df06a66a8f337 100644
--- a/llvm/docs/ReleaseNotes.md
+++ b/llvm/docs/ReleaseNotes.md
@@ -164,6 +164,10 @@ Makes programs 10x faster by doing Special New Thing.
 * Removed `TargetOptions::FloatABIType`. The soft float ABI should be
   controlled by setting the `"float-abi"` module flag.
 
+* Removed `TargetOptions::EABIVersion` and the `llc`/`opt` `-meabi` flag. The
+  GNU-vs-EABI distinction is now derived entirely from the target triple's
+  environment (e.g. `arm-none-gnueabi` vs `arm-none-eabi`).
+
 ### Changes to building LLVM
 
 * The DirectX backend is now an official target and has moved from
diff --git a/llvm/include/llvm/Analysis/RuntimeLibcallInfo.h 
b/llvm/include/llvm/Analysis/RuntimeLibcallInfo.h
index f4d81b2f1e057..2742e5ba4a348 100644
--- a/llvm/include/llvm/Analysis/RuntimeLibcallInfo.h
+++ b/llvm/include/llvm/Analysis/RuntimeLibcallInfo.h
@@ -23,11 +23,10 @@ class LLVM_ABI RuntimeLibraryAnalysis
 
   RuntimeLibraryAnalysis() = default;
   RuntimeLibraryAnalysis(ExceptionHandling ExceptionModel,
-                         EABI EABIVersion = EABI::Default,
                          StringRef ABIName = "",
                          VectorLibrary VecLib = VectorLibrary::NoLibrary)
-      : ExceptionModel(ExceptionModel), EABIVersion(EABIVersion),
-        ABIName(ABIName.str()), VecLib(VecLib) {}
+      : ExceptionModel(ExceptionModel), ABIName(ABIName.str()), VecLib(VecLib) 
{
+  }
 
   RTLIB::RuntimeLibcallsInfo run(const Module &M, ModuleAnalysisManager &);
 
@@ -39,7 +38,6 @@ class LLVM_ABI RuntimeLibraryAnalysis
   // IR, copied here so run() can forward them to the RuntimeLibcallsInfo 
Module
   // constructor. Delete each one as they are migrated to module flags.
   ExceptionHandling ExceptionModel = ExceptionHandling::None;
-  EABI EABIVersion = EABI::Default;
   std::string ABIName;
   VectorLibrary VecLib = VectorLibrary::NoLibrary;
 };
@@ -52,7 +50,6 @@ class LLVM_ABI RuntimeLibraryInfoWrapper : public 
ImmutablePass {
   static char ID;
   RuntimeLibraryInfoWrapper();
   RuntimeLibraryInfoWrapper(ExceptionHandling ExceptionModel,
-                            EABI EABIVersion = EABI::Default,
                             StringRef ABIName = "",
                             VectorLibrary VecLib = VectorLibrary::NoLibrary);
 
diff --git a/llvm/include/llvm/CodeGen/CommandFlags.h 
b/llvm/include/llvm/CodeGen/CommandFlags.h
index 767c59c1a262a..1a5d44570430f 100644
--- a/llvm/include/llvm/CodeGen/CommandFlags.h
+++ b/llvm/include/llvm/CodeGen/CommandFlags.h
@@ -105,8 +105,6 @@ LLVM_ABI bool getUniqueBasicBlockSectionNames();
 
 LLVM_ABI bool getSeparateNamedSections();
 
-LLVM_ABI llvm::EABI getEABIVersion();
-
 LLVM_ABI llvm::DebuggerKind getDebuggerTuningOpt();
 
 LLVM_ABI llvm::VectorLibrary getVectorLibrary();
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.h 
b/llvm/include/llvm/IR/RuntimeLibcalls.h
index b864e68611337..4d119c5494b43 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.h
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.h
@@ -88,20 +88,17 @@ struct RuntimeLibcallsInfo {
   LLVM_ABI explicit RuntimeLibcallsInfo(
       const Triple &TT,
       ExceptionHandling ExceptionModel = ExceptionHandling::None,
-      FloatABI::ABIType FloatABI = FloatABI::Default,
-      EABI EABIVersion = EABI::Default, StringRef ABIName = "",
+      FloatABI::ABIType FloatABI = FloatABI::Default, StringRef ABIName = "",
       VectorLibrary VecLib = VectorLibrary::NoLibrary);
 
   // FIXME: The floating-point ABI is read from the "float-abi" module flag, 
but
-  // the ExceptionModel/EABIVersion/ABIName/VecLib parameters are still
-  // TargetOptions values that are not yet represented in the IR. Delete these
-  // parameters (and build everything from the Module) once those fields are
-  // migrated to module flags.
+  // the ExceptionModel/ABIName/VecLib parameters are still TargetOptions 
values
+  // that are not yet represented in the IR. Delete these parameters (and build
+  // everything from the Module) once those fields are migrated to module 
flags.
   LLVM_ABI explicit RuntimeLibcallsInfo(
       const Module &M,
       ExceptionHandling ExceptionModel = ExceptionHandling::None,
-      EABI EABIVersion = EABI::Default, StringRef ABIName = "",
-      VectorLibrary VecLib = VectorLibrary::NoLibrary);
+      StringRef ABIName = "", VectorLibrary VecLib = VectorLibrary::NoLibrary);
 
   LLVM_ABI bool invalidate(Module &M, const PreservedAnalyses &PA,
                            ModuleAnalysisManager::Invalidator &);
@@ -246,15 +243,14 @@ struct RuntimeLibcallsInfo {
   /// Generated by tablegen.
   void setTargetRuntimeLibcallSets(const Triple &TT,
                                    ExceptionHandling ExceptionModel,
-                                   FloatABI::ABIType FloatABI, EABI ABIType,
+                                   FloatABI::ABIType FloatABI,
                                    StringRef ABIName,
                                    LongDoubleFormat LongDoubleFormat);
 
   /// Set default libcall names. If a target wants to opt-out of a libcall it
   /// should be placed here.
   LLVM_ABI void initLibcalls(const Triple &TT, ExceptionHandling 
ExceptionModel,
-                             FloatABI::ABIType FloatABI, EABI ABIType,
-                             StringRef ABIName,
+                             FloatABI::ABIType FloatABI, StringRef ABIName,
                              LongDoubleFormat LongDoubleFormat);
 };
 
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.td 
b/llvm/include/llvm/IR/RuntimeLibcalls.td
index 14dda6baf5a53..46b9aba86ddd6 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.td
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.td
@@ -56,8 +56,10 @@ class OSVersionAtLeast<int major, int minor>
                      # [{, }] # !cast<string>(minor) # [{)}]>;
 
 def IsAAPCS_ABI : LibcallPredicate<[{isAAPCS_ABI(TT, ABIName)}]>;
-def IsEABI4 : LibcallPredicate<[{EABIVersion == EABI::EABI4}]>;
-def IsEABI5 : LibcallPredicate<[{EABIVersion == EABI::EABI5}]>;
+
+// A numbered EABI (4/5) rather than GNU, i.e. not GNU/Musl AEABI.
+def IsEABIVersion
+  : LibcallPredicate<[{!TT.isTargetGNUAEABI() && !TT.isTargetMuslAEABI()}]>;
 
 def IsLongDoubleF128 : LibcallPredicate<[{LongDoubleFormat == 
LongDoubleFormat::IEEEquad}]>;
 def IsLongDoubleX87 : LibcallPredicate<[{LongDoubleFormat == 
LongDoubleFormat::X87DoubleExtended}]>;
@@ -2722,7 +2724,7 @@ def AEABI45MemCalls : LibcallImpls<
        __aeabi_memset, __aeabi_memset4, __aeabi_memset8,
        __aeabi_memclr, __aeabi_memclr4, __aeabi_memclr8),
   RuntimeLibcallAvailability<
-    (all_of (any_of IsEABI4, IsEABI5),
+    (all_of IsEABIVersion,
             (any_of IsTargetAEABI, IsTargetGNUAEABI, IsTargetMuslAEABI,
                     IsOSFuchsia, IsAndroid),
             IsAAPCS_ABI)>> {
diff --git a/llvm/include/llvm/Target/TargetOptions.h 
b/llvm/include/llvm/Target/TargetOptions.h
index 78ad27a00e4f9..f76d3770ccd0d 100644
--- a/llvm/include/llvm/Target/TargetOptions.h
+++ b/llvm/include/llvm/Target/TargetOptions.h
@@ -300,9 +300,6 @@ class TargetOptions {
   /// If greater than 0, override TargetLoweringBase::PrefLoopAlignment.
   unsigned LoopAlignment = 0;
 
-  /// EABIVersion - This flag specifies the EABI version
-  EABI EABIVersion = EABI::Default;
-
   /// Which debugger to tune for.
   DebuggerKind DebuggerTuning = DebuggerKind::Default;
 
diff --git a/llvm/lib/Analysis/RuntimeLibcallInfo.cpp 
b/llvm/lib/Analysis/RuntimeLibcallInfo.cpp
index 23dca93c4d884..ce79008539ca3 100644
--- a/llvm/lib/Analysis/RuntimeLibcallInfo.cpp
+++ b/llvm/lib/Analysis/RuntimeLibcallInfo.cpp
@@ -15,8 +15,7 @@ AnalysisKey RuntimeLibraryAnalysis::Key;
 
 RTLIB::RuntimeLibcallsInfo
 RuntimeLibraryAnalysis::run(const Module &M, ModuleAnalysisManager &) {
-  return RTLIB::RuntimeLibcallsInfo(M, ExceptionModel, EABIVersion, ABIName,
-                                    VecLib);
+  return RTLIB::RuntimeLibcallsInfo(M, ExceptionModel, ABIName, VecLib);
 }
 
 INITIALIZE_PASS(RuntimeLibraryInfoWrapper, "runtime-library-info",
@@ -25,9 +24,8 @@ INITIALIZE_PASS(RuntimeLibraryInfoWrapper, 
"runtime-library-info",
 RuntimeLibraryInfoWrapper::RuntimeLibraryInfoWrapper() : ImmutablePass(ID) {}
 
 RuntimeLibraryInfoWrapper::RuntimeLibraryInfoWrapper(
-    ExceptionHandling ExceptionModel, EABI EABIVersion, StringRef ABIName,
-    VectorLibrary VecLib)
-    : ImmutablePass(ID), RTLA(ExceptionModel, EABIVersion, ABIName, VecLib) {}
+    ExceptionHandling ExceptionModel, StringRef ABIName, VectorLibrary VecLib)
+    : ImmutablePass(ID), RTLA(ExceptionModel, ABIName, VecLib) {}
 
 char RuntimeLibraryInfoWrapper::ID = 0;
 
diff --git a/llvm/lib/CodeGen/CodeGenTargetMachineImpl.cpp 
b/llvm/lib/CodeGen/CodeGenTargetMachineImpl.cpp
index 94e0dbeac6f35..b1657a9ea5583 100644
--- a/llvm/lib/CodeGen/CodeGenTargetMachineImpl.cpp
+++ b/llvm/lib/CodeGen/CodeGenTargetMachineImpl.cpp
@@ -126,9 +126,8 @@ addPassesToGenerateCode(CodeGenTargetMachineImpl &TM, 
PassManagerBase &PM,
   const TargetOptions &Options = TM.Options;
   TargetLibraryInfoImpl TLII(TM.getTargetTriple(), Options.VecLib);
   PM.add(new TargetLibraryInfoWrapperPass(TLII));
-  PM.add(
-      new RuntimeLibraryInfoWrapper(Options.ExceptionModel, 
Options.EABIVersion,
-                                    Options.MCOptions.ABIName, 
Options.VecLib));
+  PM.add(new RuntimeLibraryInfoWrapper(
+      Options.ExceptionModel, Options.MCOptions.ABIName, Options.VecLib));
 
   invokeGlobalTargetPassConfigCallbacks(TM, PM, PassConfig);
 
diff --git a/llvm/lib/CodeGen/CommandFlags.cpp 
b/llvm/lib/CodeGen/CommandFlags.cpp
index bf53b28c13a82..c6758789a4874 100644
--- a/llvm/lib/CodeGen/CommandFlags.cpp
+++ b/llvm/lib/CodeGen/CommandFlags.cpp
@@ -98,7 +98,6 @@ CGOPT_EXP(bool, EnableTLSDESC)
 CGOPT(bool, UniqueSectionNames)
 CGOPT(bool, UniqueBasicBlockSectionNames)
 CGOPT(bool, SeparateNamedSections)
-CGOPT(EABI, EABIVersion)
 CGOPT(DebuggerKind, DebuggerTuningOpt)
 CGOPT(VectorLibrary, VectorLibrary)
 CGOPT(bool, EnableStackSizeSection)
@@ -371,16 +370,6 @@ codegen::RegisterCodeGenFlags::RegisterCodeGenFlags() {
       cl::init(false));
   CGBINDOPT(SeparateNamedSections);
 
-  static cl::opt<EABI> EABIVersion(
-      "meabi", cl::desc("Set EABI type (default depends on triple):"),
-      cl::init(EABI::Default),
-      cl::values(
-          clEnumValN(EABI::Default, "default", "Triple default EABI version"),
-          clEnumValN(EABI::EABI4, "4", "EABI version 4"),
-          clEnumValN(EABI::EABI5, "5", "EABI version 5"),
-          clEnumValN(EABI::GNU, "gnu", "EABI GNU")));
-  CGBINDOPT(EABIVersion);
-
   static cl::opt<DebuggerKind> DebuggerTuningOpt(
       "debugger-tune", cl::desc("Tune debug info for a particular debugger"),
       cl::init(DebuggerKind::Default),
@@ -575,7 +564,6 @@ codegen::InitTargetOptionsFromCodeGenFlags(const Triple 
&TheTriple) {
 
   Options.MCOptions = mc::InitMCTargetOptionsFromFlags();
 
-  Options.EABIVersion = getEABIVersion();
   Options.DebuggerTuning = getDebuggerTuningOpt();
   Options.SwiftAsyncFramePointer = getSwiftAsyncFramePointer();
   return Options;
diff --git a/llvm/lib/CodeGen/TargetLoweringBase.cpp 
b/llvm/lib/CodeGen/TargetLoweringBase.cpp
index 2cd7bc1d442cb..f852f7551ce16 100644
--- a/llvm/lib/CodeGen/TargetLoweringBase.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringBase.cpp
@@ -719,7 +719,6 @@ TargetLoweringBase::TargetLoweringBase(const TargetMachine 
&tm,
     : TM(tm),
       RuntimeLibcallInfo(TM.getTargetTriple(), TM.Options.ExceptionModel,
                          TM.getTargetTriple().getDefaultFloatABI(),
-                         TM.Options.EABIVersion,
                          TM.Options.MCOptions.getABIName(), TM.Options.VecLib),
       Libcalls(RuntimeLibcallInfo, [&STI](LibcallLoweringInfo &Info) {
         STI.initLibcallLoweringInfo(Info);
diff --git a/llvm/lib/IR/RuntimeLibcalls.cpp b/llvm/lib/IR/RuntimeLibcalls.cpp
index 89a5a929bec01..92872ac738dfe 100644
--- a/llvm/lib/IR/RuntimeLibcalls.cpp
+++ b/llvm/lib/IR/RuntimeLibcalls.cpp
@@ -29,7 +29,7 @@ using namespace RTLIB;
 RuntimeLibcallsInfo::RuntimeLibcallsInfo(const Triple &TT,
                                          ExceptionHandling ExceptionModel,
                                          FloatABI::ABIType FloatABI,
-                                         EABI EABIVersion, StringRef ABIName,
+                                         StringRef ABIName,
                                          VectorLibrary VecLib) {
   // FIXME: The ExceptionModel parameter is to handle the field in
   // TargetOptions. This interface fails to distinguish the forced disable
@@ -38,7 +38,7 @@ RuntimeLibcallsInfo::RuntimeLibcallsInfo(const Triple &TT,
   if (ExceptionModel == ExceptionHandling::None)
     ExceptionModel = TT.getDefaultExceptionHandling();
 
-  initLibcalls(TT, ExceptionModel, FloatABI, EABIVersion, ABIName,
+  initLibcalls(TT, ExceptionModel, FloatABI, ABIName,
                TT.getDefaultLongDoubleFormat());
 
   // TODO: Tablegen should generate these sets
@@ -105,10 +105,10 @@ RuntimeLibcallsInfo::RuntimeLibcallsInfo(const Triple &TT,
 // TODO: Consider the remaining module flags.
 RuntimeLibcallsInfo::RuntimeLibcallsInfo(const Module &M,
                                          ExceptionHandling ExceptionModel,
-                                         EABI EABIVersion, StringRef ABIName,
+                                         StringRef ABIName,
                                          VectorLibrary VecLib)
     : RuntimeLibcallsInfo(M.getTargetTriple(), ExceptionModel, M.getFloatABI(),
-                          EABIVersion, ABIName, VecLib) {}
+                          ABIName, VecLib) {}
 
 bool RuntimeLibcallsInfo::isLibraryAvailable(StringRef LibraryName) const {
   // TODO: Drive this from module-level state (e.g. the linked runtime). For 
now
@@ -121,10 +121,10 @@ bool RuntimeLibcallsInfo::isLibraryAvailable(StringRef 
LibraryName) const {
 void RuntimeLibcallsInfo::initLibcalls(const Triple &TT,
                                        ExceptionHandling ExceptionModel,
                                        FloatABI::ABIType FloatABI,
-                                       EABI EABIVersion, StringRef ABIName,
+                                       StringRef ABIName,
                                        LongDoubleFormat LongDoubleFormat) {
-  setTargetRuntimeLibcallSets(TT, ExceptionModel, FloatABI, EABIVersion,
-                              ABIName, LongDoubleFormat);
+  setTargetRuntimeLibcallSets(TT, ExceptionModel, FloatABI, ABIName,
+                              LongDoubleFormat);
 }
 
 LLVM_ATTRIBUTE_ALWAYS_INLINE
diff --git a/llvm/lib/LTO/LTOBackend.cpp b/llvm/lib/LTO/LTOBackend.cpp
index 69bc3fdae6c57..11c9b2f61988b 100644
--- a/llvm/lib/LTO/LTOBackend.cpp
+++ b/llvm/lib/LTO/LTOBackend.cpp
@@ -485,8 +485,8 @@ static void codegen(const Config &Conf, TargetMachine *TM,
     TargetLibraryInfoImpl TLII(Mod.getTargetTriple(), TM->Options.VecLib);
     CodeGenPasses.add(new TargetLibraryInfoWrapperPass(TLII));
     CodeGenPasses.add(new RuntimeLibraryInfoWrapper(
-        TM->Options.ExceptionModel, TM->Options.EABIVersion,
-        TM->Options.MCOptions.ABIName, TM->Options.VecLib));
+        TM->Options.ExceptionModel, TM->Options.MCOptions.ABIName,
+        TM->Options.VecLib));
 
     // No need to make index available if the module is empty.
     // In theory these passes should not use the index for an empty
diff --git a/llvm/lib/Passes/RunCodeGen.cpp b/llvm/lib/Passes/RunCodeGen.cpp
index adcebe0d6ad20..aae30c47389c2 100644
--- a/llvm/lib/Passes/RunCodeGen.cpp
+++ b/llvm/lib/Passes/RunCodeGen.cpp
@@ -46,9 +46,8 @@ runCodeGenPipelineLegacy(TargetMachine &TM, Module &M, 
raw_pwrite_stream &OS,
   CodeGenPasses.add(new TargetLibraryInfoWrapperPass(TLII));
 
   const TargetOptions &Options = TM.Options;
-  CodeGenPasses.add(
-      new RuntimeLibraryInfoWrapper(Options.ExceptionModel, 
Options.EABIVersion,
-                                    Options.MCOptions.ABIName, 
Options.VecLib));
+  CodeGenPasses.add(new RuntimeLibraryInfoWrapper(
+      Options.ExceptionModel, Options.MCOptions.ABIName, Options.VecLib));
 
   if (TM.addPassesToEmitFile(CodeGenPasses, OS, DwoOS ? &DwoOS->os() : nullptr,
                              CGFT, DisableVerify))
diff --git a/llvm/lib/Target/ARM/ARMTargetMachine.cpp 
b/llvm/lib/Target/ARM/ARMTargetMachine.cpp
index 66c6c09b4b27b..7e82cb14c6616 100644
--- a/llvm/lib/Target/ARM/ARMTargetMachine.cpp
+++ b/llvm/lib/Target/ARM/ARMTargetMachine.cpp
@@ -159,23 +159,6 @@ ARMBaseTargetMachine::ARMBaseTargetMachine(const Target 
&T, const Triple &TT,
       TargetABI(ARM::computeTargetABI(TT, Options.MCOptions.ABIName)),
       TLOF(createTLOF(getTargetTriple())), isLittle(TT.isLittleEndian()) {
 
-  // Default to triple-appropriate EABI
-  if (Options.EABIVersion == EABI::Default ||
-      Options.EABIVersion == EABI::Unknown) {
-    // musl is compatible with glibc with regard to EABI version
-    if ((TargetTriple.getEnvironment() == Triple::GNUEABI ||
-         TargetTriple.getEnvironment() == Triple::GNUEABIT64 ||
-         TargetTriple.getEnvironment() == Triple::GNUEABIHF ||
-         TargetTriple.getEnvironment() == Triple::GNUEABIHFT64 ||
-         TargetTriple.getEnvironment() == Triple::MuslEABI ||
-         TargetTriple.getEnvironment() == Triple::MuslEABIHF ||
-         TargetTriple.getEnvironment() == Triple::OpenHOS) &&
-        !(TargetTriple.isOSWindows() || TargetTriple.isOSDarwin()))
-      this->Options.EABIVersion = EABI::GNU;
-    else
-      this->Options.EABIVersion = EABI::EABI5;
-  }
-
   if (TT.isOSBinFormatMachO()) {
     this->Options.TrapUnreachable = true;
     this->Options.NoTrapAfterNoreturn = true;
diff --git a/llvm/test/CodeGen/ARM/arm-eabi.ll 
b/llvm/test/CodeGen/ARM/arm-eabi.ll
index b2972ba97469e..48d592206cbba 100644
--- a/llvm/test/CodeGen/ARM/arm-eabi.ll
+++ b/llvm/test/CodeGen/ARM/arm-eabi.ll
@@ -5,27 +5,10 @@
 ; RUN: llc < %s -mtriple=arm-none-gnueabihf -mattr=+vfp2 -disable-post-ra -o - 
| FileCheck %s --check-prefix=CHECK-GNUEABI
 ; RUN: llc < %s -mtriple=arm-none-musleabi -disable-post-ra -o - | FileCheck 
%s --check-prefix=CHECK-GNUEABI
 ; RUN: llc < %s -mtriple=arm-none-musleabihf -mattr=+vfp2 -disable-post-ra -o 
- | FileCheck %s --check-prefix=CHECK-GNUEABI
-; RUN: llc < %s -mtriple=arm-none-eabi -meabi=gnu -disable-post-ra -o - | 
FileCheck %s --check-prefix=CHECK-GNUEABI
-; RUN: llc < %s -mtriple=arm-none-eabihf -mattr=+vfp2 -meabi=gnu 
-disable-post-ra -o - | FileCheck %s --check-prefix=CHECK-GNUEABI
-; RUN: llc < %s -mtriple=arm-none-androideabi -meabi=gnu -disable-post-ra -o - 
| FileCheck %s --check-prefix=CHECK-GNUEABI
-; RUN: llc < %s -mtriple=arm-none-gnueabi -meabi=gnu -disable-post-ra -o - | 
FileCheck %s --check-prefix=CHECK-GNUEABI
-; RUN: llc < %s -mtriple=arm-none-gnueabihf -mattr=+vfp2 -meabi=gnu 
-disable-post-ra -o - | FileCheck %s --check-prefix=CHECK-GNUEABI
-; RUN: llc < %s -mtriple=arm-none-musleabi -meabi=gnu -disable-post-ra -o - | 
FileCheck %s --check-prefix=CHECK-GNUEABI
-; RUN: llc < %s -mtriple=arm-none-musleabihf -mattr=+vfp2 -meabi=gnu 
-disable-post-ra -o - | FileCheck %s --check-prefix=CHECK-GNUEABI
-; RUN: llc < %s -mtriple=arm-none-eabi -meabi=4 -disable-post-ra -o - | 
FileCheck %s --check-prefix=CHECK-EABI
-; RUN: llc < %s -mtriple=arm-none-eabihf -mattr=+vfp2 -meabi=4 
-disable-post-ra -o - | FileCheck %s --check-prefix=CHECK-EABI
-; RUN: llc < %s -mtriple=arm-none-androideabi -meabi=4 -disable-post-ra -o - | 
FileCheck %s --check-prefix=CHECK-EABI
-; RUN: llc < %s -mtriple=arm-none-gnueabi -meabi=4 -disable-post-ra -o - | 
FileCheck %s --check-prefix=CHECK-EABI
-; RUN: llc < %s -mtriple=arm-none-gnueabihf -mattr=+vfp2 -meabi=4 
-disable-post-ra -o - | FileCheck %s --check-prefix=CHECK-EABI
-; RUN: llc < %s -mtriple=arm-none-musleabi -meabi=4 -disable-post-ra -o - | 
FileCheck %s --check-prefix=CHECK-EABI
-; RUN: llc < %s -mtriple=arm-none-musleabihf -mattr=+vfp2 -meabi=4 
-disable-post-ra -o - | FileCheck %s --check-prefix=CHECK-EABI
-; RUN: llc < %s -mtriple=arm-none-eabi -meabi=5 -disable-post-ra -o - | 
FileCheck %s --check-prefix=CHECK-EABI
-; RUN: llc < %s -mtriple=arm-none-eabihf -mattr=+vfp2 -meabi=5 
-disable-post-ra -o - | FileCheck %s --check-prefix=CHECK-EABI
-; RUN: llc < %s -mtriple=arm-none-androideabi -meabi=5 -disable-post-ra -o - | 
FileCheck %s --check-prefix=CHECK-EABI
-; RUN: llc < %s -mtriple=arm-none-gnueabi -meabi=5 -disable-post-ra -o - | 
FileCheck %s --check-prefix=CHECK-EABI
-; RUN: llc < %s -mtriple=arm-none-gnueabihf -mattr=+vfp2 -meabi=5 
-disable-post-ra -o - | FileCheck %s --check-prefix=CHECK-EABI
-; RUN: llc < %s -mtriple=arm-none-musleabi -meabi=5 -disable-post-ra -o - | 
FileCheck %s --check-prefix=CHECK-EABI
-; RUN: llc < %s -mtriple=arm-none-musleabihf -mattr=+vfp2 -meabi=5 
-disable-post-ra -o - | FileCheck %s --check-prefix=CHECK-EABI
+
+; The EABI version (numbered EABI vs GNU) is derived entirely from the triple
+; environment. The clang driver rewrites -meabi=gnu/5 into the triple, so the
+; matrix above already covers every case the old llc -meabi flag exercised.
 
 %struct.my_s = type { [18 x i32] }
 
diff --git a/llvm/test/CodeGen/ARM/float-helpers.ll 
b/llvm/test/CodeGen/ARM/float-helpers.ll
index 1225b4c999f16..afca9936e05e2 100644
--- a/llvm/test/CodeGen/ARM/float-helpers.ll
+++ b/llvm/test/CodeGen/ARM/float-helpers.ll
@@ -1,12 +1,12 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
 ; RUN: llc -asm-verbose=false -mattr=-vfp2 -mtriple=arm-eabi < %s | FileCheck 
%s -check-prefix=CHECK-SOFT
-; RUN: llc -asm-verbose=false -mattr=-vfp2 -mtriple=arm-eabi -meabi=gnu < %s | 
FileCheck %s -check-prefix=CHECK-SOFT
+; RUN: llc -asm-verbose=false -mattr=-vfp2 -mtriple=arm-gnueabi < %s | 
FileCheck %s -check-prefix=CHECK-SOFT
 ; RUN: llc -asm-verbose=false -mattr=+vfp3 -mtriple=arm-eabi < %s | FileCheck 
%s -check-prefix=CHECK-SOFTFP
-; RUN: llc -asm-verbose=false -mattr=+vfp3 -meabi=gnu -mtriple=arm-eabi < %s | 
FileCheck %s -check-prefix=CHECK-SOFTFP
+; RUN: llc -asm-verbose=false -mattr=+vfp3 -mtriple=arm-gnueabi < %s | 
FileCheck %s -check-prefix=CHECK-SOFTFP
 ; RUN: llc -asm-verbose=false -mattr=+vfp3 -float-abi=hard -mtriple=arm-eabi < 
%s | FileCheck %s -check-prefix=CHECK-HARDFP-SP -check-prefix=CHECK-HARDFP-DP
-; RUN: llc -asm-verbose=false -mattr=+vfp3 -float-abi=hard -meabi=gnu 
-mtriple=arm-eabi < %s | FileCheck %s -check-prefix=CHECK-HARDFP-SP 
-check-prefix=CHECK-HARDFP-DP
+; RUN: llc -asm-verbose=false -mattr=+vfp3 -float-abi=hard 
-mtriple=arm-gnueabi < %s | FileCheck %s -check-prefix=CHECK-HARDFP-SP 
-check-prefix=CHECK-HARDFP-DP
 ; RUN: llc -asm-verbose=false -mattr=+vfp3,-fp64 -float-abi=hard 
-mtriple=arm-eabi < %s | FileCheck %s -check-prefix=CHECK-HARDFP-SP 
-check-prefix=CHECK-HARDFP-SPONLY
-; RUN: llc -asm-verbose=false -mattr=+vfp3,-fp64 -float-abi=hard 
-mtriple=arm-eabi -meabi=gnu < %s | FileCheck %s -check-prefix=CHECK-HARDFP-SP 
-check-prefix=CHECK-HARDFP-SPONLY
+; RUN: llc -asm-verbose=false -mattr=+vfp3,-fp64 -float-abi=hard 
-mtriple=arm-gnueabi < %s | FileCheck %s -check-prefix=CHECK-HARDFP-SP 
-check-prefix=CHECK-HARDFP-SPONLY
 
 ; The Runtime ABI for the ARM Architecture IHI0043 section 4.1.2 The
 ; floating-point helper functions to always use the base AAPCS (soft-float)
diff --git a/llvm/test/TableGen/RuntimeLibcallEmitter-calling-conv.td 
b/llvm/test/TableGen/RuntimeLibcallEmitter-calling-conv.td
index cd1f59067c7ba..250ef6c9e75fc 100644
--- a/llvm/test/TableGen/RuntimeLibcallEmitter-calling-conv.td
+++ b/llvm/test/TableGen/RuntimeLibcallEmitter-calling-conv.td
@@ -46,7 +46,7 @@ def MSP430LibraryWithCondCC : SystemRuntimeLibrary<isMSP430,
 >;
 
 
-// CHECK: void 
llvm::RTLIB::RuntimeLibcallsInfo::setTargetRuntimeLibcallSets(const 
llvm::Triple &TT, ExceptionHandling ExceptionModel, FloatABI::ABIType FloatABI, 
EABI EABIVersion, StringRef ABIName, LongDoubleFormat LongDoubleFormat) {
+// CHECK: void 
llvm::RTLIB::RuntimeLibcallsInfo::setTargetRuntimeLibcallSets(const 
llvm::Triple &TT, ExceptionHandling ExceptionModel, FloatABI::ABIType FloatABI, 
StringRef ABIName, LongDoubleFormat LongDoubleFormat) {
 // CHECK: if (TT.getArch() == Triple::avr && TT.isOSHurd()) {
 // CHECK-NEXT:   const CallingConv::ID DefaultCC = isFoo() ? CallingConv::Fast 
: CallingConv::GHC;
 // CHECK-NEXT:   for (CallingConv::ID &Entry : LibcallImplCallingConvs) {
diff --git a/llvm/test/TableGen/RuntimeLibcallEmitter-library-dispatch.td 
b/llvm/test/TableGen/RuntimeLibcallEmitter-library-dispatch.td
index 87c6acc9493ac..05d641a091b43 100644
--- a/llvm/test/TableGen/RuntimeLibcallEmitter-library-dispatch.td
+++ b/llvm/test/TableGen/RuntimeLibcallEmitter-library-dispatch.td
@@ -32,15 +32,15 @@ def X86System : SystemRuntimeLibrary<isX86, (add Libc, 
Libm, extra)>;
 // The driver dispatches to each named library under its presence guard, then
 // emits the bare member (extra) inline.
 
-// CHECK: void 
llvm::RTLIB::RuntimeLibcallsInfo::setTargetRuntimeLibcallSets(const 
llvm::Triple &TT, ExceptionHandling ExceptionModel, FloatABI::ABIType FloatABI, 
EABI EABIVersion, StringRef ABIName, LongDoubleFormat LongDoubleFormat) {
+// CHECK: void 
llvm::RTLIB::RuntimeLibcallsInfo::setTargetRuntimeLibcallSets(const 
llvm::Triple &TT, ExceptionHandling ExceptionModel, FloatABI::ABIType FloatABI, 
StringRef ABIName, LongDoubleFormat LongDoubleFormat) {
 // CHECK:   if (TT.isX86()) {
 // CHECK-NEXT:     static constexpr LibcallImplBitset SystemAvailableImpls({
 // CHECK: AvailableLibcallImpls = SystemAvailableImpls;
 // CHECK-EMPTY:
 // CHECK-NEXT:     if (isLibraryAvailable("libc"))
-// CHECK-NEXT:       setAvailableLibFuncs_libc(TT, ExceptionModel, FloatABI, 
EABIVersion, ABIName, LongDoubleFormat);
+// CHECK-NEXT:       setAvailableLibFuncs_libc(TT, ExceptionModel, FloatABI, 
ABIName, LongDoubleFormat);
 // CHECK-NEXT:     if (isLibraryAvailable("libm"))
-// CHECK-NEXT:       setAvailableLibFuncs_libm(TT, ExceptionModel, FloatABI, 
EABIVersion, ABIName, LongDoubleFormat);
+// CHECK-NEXT:       setAvailableLibFuncs_libm(TT, ExceptionModel, FloatABI, 
ABIName, LongDoubleFormat);
 // CHECK-EMPTY:
 // CHECK-NEXT:     static const RTLIB::LibcallImpl LibraryCalls[] = {
 // CHECK-NEXT:         RTLIB::impl_extra, // extra
diff --git a/llvm/test/TableGen/RuntimeLibcallEmitter-library-grouping.td 
b/llvm/test/TableGen/RuntimeLibcallEmitter-library-grouping.td
index 59d864f195906..e5cad3206a430 100644
--- a/llvm/test/TableGen/RuntimeLibcallEmitter-library-grouping.td
+++ b/llvm/test/TableGen/RuntimeLibcallEmitter-library-grouping.td
@@ -31,7 +31,7 @@ def Libm : LibcallLibrary<"libm", (add sqrt,
 
 // One standalone implementation function is emitted per LibcallLibrary.
 
-// CHECK: void 
llvm::RTLIB::RuntimeLibcallsInfo::setAvailableLibFuncs_libc(const llvm::Triple 
&TT, ExceptionHandling ExceptionModel, FloatABI::ABIType FloatABI, EABI 
EABIVersion, StringRef ABIName, LongDoubleFormat LongDoubleFormat) {
+// CHECK: void 
llvm::RTLIB::RuntimeLibcallsInfo::setAvailableLibFuncs_libc(const llvm::Triple 
&TT, ExceptionHandling ExceptionModel, FloatABI::ABIType FloatABI, StringRef 
ABIName, LongDoubleFormat LongDoubleFormat) {
 // CHECK-NEXT:   {
 // CHECK-NEXT:     static const RTLIB::LibcallImpl LibraryCalls[] = {
 // CHECK-NEXT:         RTLIB::impl_memcpy, // memcpy
@@ -55,7 +55,7 @@ def Libm : LibcallLibrary<"libm", (add sqrt,
 // CHECK-NEXT:   }
 // CHECK-NEXT: }
 
-// CHECK: void 
llvm::RTLIB::RuntimeLibcallsInfo::setAvailableLibFuncs_libm(const llvm::Triple 
&TT, ExceptionHandling ExceptionModel, FloatABI::ABIType FloatABI, EABI 
EABIVersion, StringRef ABIName, LongDoubleFormat LongDoubleFormat) {
+// CHECK: void 
llvm::RTLIB::RuntimeLibcallsInfo::setAvailableLibFuncs_libm(const llvm::Triple 
&TT, ExceptionHandling ExceptionModel, FloatABI::ABIType FloatABI, StringRef 
ABIName, LongDoubleFormat LongDoubleFormat) {
 // CHECK-NEXT:   {
 // CHECK-NEXT:     static const RTLIB::LibcallImpl LibraryCalls[] = {
 // CHECK-NEXT:         RTLIB::impl_sqrt, // sqrt
diff --git a/llvm/test/TableGen/RuntimeLibcallEmitter-library-name-merge.td 
b/llvm/test/TableGen/RuntimeLibcallEmitter-library-name-merge.td
index f44ae67e62d38..692fa2475b6aa 100644
--- a/llvm/test/TableGen/RuntimeLibcallEmitter-library-name-merge.td
+++ b/llvm/test/TableGen/RuntimeLibcallEmitter-library-name-merge.td
@@ -42,7 +42,7 @@ def DarwinLibm : LibcallLibrary<"libm", (add sqrt)> { let 
Pred = isDarwin; }
 // The shared core (memcpy, memset) is emitted once and unguarded; each 
variant's
 // guarded block carries only its own extras (bzero for Darwin, stpcpy for 
GNU).
 
-// CHECK: void 
llvm::RTLIB::RuntimeLibcallsInfo::setAvailableLibFuncs_libc(const llvm::Triple 
&TT, ExceptionHandling ExceptionModel, FloatABI::ABIType FloatABI, EABI 
EABIVersion, StringRef ABIName, LongDoubleFormat LongDoubleFormat) {
+// CHECK: void 
llvm::RTLIB::RuntimeLibcallsInfo::setAvailableLibFuncs_libc(const llvm::Triple 
&TT, ExceptionHandling ExceptionModel, FloatABI::ABIType FloatABI, StringRef 
ABIName, LongDoubleFormat LongDoubleFormat) {
 // CHECK-NEXT:   static const RTLIB::LibcallImpl LibraryCalls[] = {
 // CHECK-NEXT:       RTLIB::impl_memcpy, // memcpy
 // CHECK-NEXT:       RTLIB::impl_memset, // memset
@@ -77,7 +77,7 @@ def DarwinLibm : LibcallLibrary<"libm", (add sqrt)> { let 
Pred = isDarwin; }
 // sqrt differs in calling convention between the two libm variants, so it 
stays
 // per-variant: no shared-core hoist, and the GNU variant keeps its ARM_AAPCS.
 
-// CHECK: void 
llvm::RTLIB::RuntimeLibcallsInfo::setAvailableLibFuncs_libm(const llvm::Triple 
&TT, ExceptionHandling ExceptionModel, FloatABI::ABIType FloatABI, EABI 
EABIVersion, StringRef ABIName, LongDoubleFormat LongDoubleFormat) {
+// CHECK: void 
llvm::RTLIB::RuntimeLibcallsInfo::setAvailableLibFuncs_libm(const llvm::Triple 
&TT, ExceptionHandling ExceptionModel, FloatABI::ABIType FloatABI, StringRef 
ABIName, LongDoubleFormat LongDoubleFormat) {
 // CHECK-NEXT:   if (TT.isOSDarwin()) {
 // CHECK-NEXT:     static const RTLIB::LibcallImpl LibraryCalls[] = {
 // CHECK-NEXT:         RTLIB::impl_sqrt, // sqrt
diff --git a/llvm/test/TableGen/RuntimeLibcallEmitter.td 
b/llvm/test/TableGen/RuntimeLibcallEmitter.td
index 51c3e02885f4b..b3ed43f26c10e 100644
--- a/llvm/test/TableGen/RuntimeLibcallEmitter.td
+++ b/llvm/test/TableGen/RuntimeLibcallEmitter.td
@@ -210,7 +210,7 @@ def BlahLibrary : SystemRuntimeLibrary<isBlahArch, (add 
calloc, LibraryWithCondi
 // CHECK: return enum_seq(RTLIB::Unsupported, RTLIB::Unsupported);
 // CHECK-NEXT: }
 
-// CHECK: void 
llvm::RTLIB::RuntimeLibcallsInfo::setTargetRuntimeLibcallSets(const 
llvm::Triple &TT, ExceptionHandling ExceptionModel, FloatABI::ABIType FloatABI, 
EABI EABIVersion, StringRef ABIName, LongDoubleFormat LongDoubleFormat) {
+// CHECK: void 
llvm::RTLIB::RuntimeLibcallsInfo::setTargetRuntimeLibcallSets(const 
llvm::Triple &TT, ExceptionHandling ExceptionModel, FloatABI::ABIType FloatABI, 
StringRef ABIName, LongDoubleFormat LongDoubleFormat) {
 // CHECK-EMPTY:
 // CHECK-NEXT: if (TT.getArch() == Triple::blah) {
 // CHECK-NEXT:     static constexpr LibcallImplBitset SystemAvailableImpls({
diff --git 
a/llvm/test/Transforms/Util/DeclareRuntimeLibcalls/codegen-opt-flags.ll 
b/llvm/test/Transforms/Util/DeclareRuntimeLibcalls/codegen-opt-flags.ll
index a5da90da6a74a..b20760b535bed 100644
--- a/llvm/test/Transforms/Util/DeclareRuntimeLibcalls/codegen-opt-flags.ll
+++ b/llvm/test/Transforms/Util/DeclareRuntimeLibcalls/codegen-opt-flags.ll
@@ -1,7 +1,7 @@
 ; REQUIRES: arm-registered-target
 
 ; Make sure that codegen flags work to change the set of libcalls
-; RUN: opt -S -passes=declare-runtime-libcalls -mtriple=arm-none-linux-gnueabi 
-float-abi=hard -exception-model=sjlj -meabi=4 < %s | FileCheck %s
+; RUN: opt -S -passes=declare-runtime-libcalls -mtriple=arm-none-eabi 
-float-abi=hard -exception-model=sjlj < %s | FileCheck %s
 
 ; Depends on -exception-model
 ; CHECK: declare arm_aapcs_vfpcc void @_Unwind_SjLj_Register(...)
diff --git a/llvm/tools/llc/lib/NewPMDriver.cpp 
b/llvm/tools/llc/lib/NewPMDriver.cpp
index fc637b3e27aee..475608de5500a 100644
--- a/llvm/tools/llc/lib/NewPMDriver.cpp
+++ b/llvm/tools/llc/lib/NewPMDriver.cpp
@@ -137,7 +137,7 @@ int llvm::compileModuleWithNewPM(
 
   MAM.registerPass([&] {
     const TargetOptions &Options = Target->Options;
-    return RuntimeLibraryAnalysis(Options.ExceptionModel, Options.EABIVersion,
+    return RuntimeLibraryAnalysis(Options.ExceptionModel,
                                   Options.MCOptions.ABIName, Options.VecLib);
   });
 
diff --git a/llvm/tools/llc/lib/llcdriver.cpp b/llvm/tools/llc/lib/llcdriver.cpp
index a41a728ad6650..94d204ed1424a 100644
--- a/llvm/tools/llc/lib/llcdriver.cpp
+++ b/llvm/tools/llc/lib/llcdriver.cpp
@@ -754,9 +754,9 @@ static int compileModule(char **argv, 
SmallVectorImpl<PassPlugin> &PluginList,
   // Build up all of the passes that we want to do to the module.
   legacy::PassManager PM;
   PM.add(new TargetLibraryInfoWrapperPass(TLII));
-  PM.add(new RuntimeLibraryInfoWrapper(
-      Target->Options.ExceptionModel, Target->Options.EABIVersion,
-      Options.MCOptions.ABIName, Target->Options.VecLib));
+  PM.add(new RuntimeLibraryInfoWrapper(Target->Options.ExceptionModel,
+                                       Options.MCOptions.ABIName,
+                                       Target->Options.VecLib));
 
   {
     raw_pwrite_stream *OS = &Out->os();
diff --git a/llvm/tools/opt/NewPMDriver.cpp b/llvm/tools/opt/NewPMDriver.cpp
index 730ee097b2d1d..11b19e65994ea 100644
--- a/llvm/tools/opt/NewPMDriver.cpp
+++ b/llvm/tools/opt/NewPMDriver.cpp
@@ -452,7 +452,7 @@ bool llvm::runPassPipeline(
 
     MAM.registerPass([&] {
       const TargetOptions &Options = TM->Options;
-      return RuntimeLibraryAnalysis(Options.ExceptionModel, 
Options.EABIVersion,
+      return RuntimeLibraryAnalysis(Options.ExceptionModel,
                                     Options.MCOptions.ABIName, Options.VecLib);
     });
   }
@@ -558,8 +558,7 @@ bool llvm::runPassPipeline(
       MPM.addPass(AssignGUIDPass());
     }
     MPM.addPass(PrintModulePass(
-        Out->os(), "", ShouldPreserveAssemblyUseListOrder, EmitSummaryIndex,
-        /*ShouldRenumberMetadata=*/true));
+        Out->os(), "", ShouldPreserveAssemblyUseListOrder, EmitSummaryIndex));
     break;
   case OK_OutputBitcode:
     if (EmitSummaryIndex) {
diff --git a/llvm/tools/opt/optdriver.cpp b/llvm/tools/opt/optdriver.cpp
index 2a9b567ee7b6d..d745725d36806 100644
--- a/llvm/tools/opt/optdriver.cpp
+++ b/llvm/tools/opt/optdriver.cpp
@@ -848,8 +848,7 @@ optMain(int argc, char **argv,
 
   Passes.add(new TargetLibraryInfoWrapperPass(TLII));
   Passes.add(new RuntimeLibraryInfoWrapper(
-      Options->ExceptionModel, Options->EABIVersion, 
Options->MCOptions.ABIName,
-      Options->VecLib));
+      Options->ExceptionModel, Options->MCOptions.ABIName, Options->VecLib));
 
   // Add internal analysis passes from the target machine.
   Passes.add(createTargetTransformInfoWrapperPass(TM ? 
TM->getTargetIRAnalysis()
@@ -927,11 +926,10 @@ optMain(int argc, char **argv,
       BOS = std::make_unique<raw_svector_ostream>(Buffer);
       OS = BOS.get();
     }
-    if (OutputAssembly) {
+    if (OutputAssembly)
       Passes.add(createPrintModulePass(
-          *OS, "", /*ShouldPreserveAssemblyUseListOrder=*/false,
-          /*ShouldRenumberMetadata=*/true));
-    } else
+          *OS, "", /* ShouldPreserveAssemblyUseListOrder */ false));
+    else
       Passes.add(createBitcodeWriterPass(
           *OS, /* ShouldPreserveBitcodeUseListOrder */ true));
   }
diff --git a/llvm/utils/TableGen/Basic/RuntimeLibcallsEmitter.cpp 
b/llvm/utils/TableGen/Basic/RuntimeLibcallsEmitter.cpp
index 3724b37e50101..690e9da5805b2 100644
--- a/llvm/utils/TableGen/Basic/RuntimeLibcallsEmitter.cpp
+++ b/llvm/utils/TableGen/Basic/RuntimeLibcallsEmitter.cpp
@@ -499,7 +499,7 @@ void RuntimeLibcallEmitter::emitLibraryFunction(
   emitLibFuncSuffix(OS, Name);
   OS << "(const llvm::Triple &TT, "
         "ExceptionHandling ExceptionModel, FloatABI::ABIType FloatABI, "
-        "EABI EABIVersion, StringRef ABIName, "
+        "StringRef ABIName, "
         "LongDoubleFormat LongDoubleFormat) {\n";
 
   // Per-variant expansion. Unconditional impls are tracked separately for
@@ -630,7 +630,7 @@ void 
RuntimeLibcallEmitter::emitRuntimeLibcallsInfoMemberDecls(
     OS << "void setAvailableLibFuncs_";
     emitLibFuncSuffix(OS, Name);
     OS << "(const llvm::Triple &TT, ExceptionHandling ExceptionModel, "
-          "FloatABI::ABIType FloatABI, EABI EABIVersion, StringRef ABIName, "
+          "FloatABI::ABIType FloatABI, StringRef ABIName, "
           "LongDoubleFormat LongDoubleFormat);\n";
   }
 }
@@ -646,7 +646,7 @@ void 
RuntimeLibcallEmitter::emitSystemRuntimeLibrarySetCalls(
 
   OS << "void llvm::RTLIB::RuntimeLibcallsInfo::setTargetRuntimeLibcallSets("
         "const llvm::Triple &TT, ExceptionHandling ExceptionModel, "
-        "FloatABI::ABIType FloatABI, EABI EABIVersion, "
+        "FloatABI::ABIType FloatABI, "
         "StringRef ABIName, LongDoubleFormat LongDoubleFormat) {\n";
 
   for (const Record *R : AllLibs) {
@@ -773,7 +773,7 @@ void 
RuntimeLibcallEmitter::emitSystemRuntimeLibrarySetCalls(
       OS << indent(4) << "if (isLibraryAvailable(\"" << LibName << "\"))\n"
          << indent(6) << "setAvailableLibFuncs_";
       emitLibFuncSuffix(OS, LibName);
-      OS << "(TT, ExceptionModel, FloatABI, EABIVersion, ABIName, "
+      OS << "(TT, ExceptionModel, FloatABI, ABIName, "
             "LongDoubleFormat);\n";
     }
     if (!DispatchLibs.empty())

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to