[llvm] [Pass] Add hyphen to some pass names (PR #74287)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 5 22:41:38 PST 2023
https://github.com/paperchalice updated https://github.com/llvm/llvm-project/pull/74287
>From 7aa15e0c81184e88deb546e03899e3c5172f9fae Mon Sep 17 00:00:00 2001
From: PaperChalice <29250197+paperchalice at users.noreply.github.com>
Date: Wed, 6 Dec 2023 13:45:43 +0800
Subject: [PATCH 01/10] [Pass] Add a `convertToNewPassName` to support renaming
---
llvm/lib/Passes/PassBuilder.cpp | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index 729b050c5d1d3..0780e04abd9df 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -1294,6 +1294,18 @@ static bool isLoopPassName(StringRef Name, CallbacksT &Callbacks,
return callbacksAcceptPassName<LoopPassManager>(Name, Callbacks);
}
+static StringRef convertToNewPassName(StringRef OldName) {
+ static StringMap<StringRef> NameMap = {{"loweratomic", "lower-atomic"}};
+
+ if (auto I = NameMap.find(OldName); I != NameMap.end()) {
+ auto NewName = I->second;
+ errs() << "WARNING: Name '" << OldName << "' is deprecated, please use '"
+ << NewName << "'.\n";
+ return NewName;
+ }
+ return OldName;
+}
+
std::optional<std::vector<PassBuilder::PipelineElement>>
PassBuilder::parsePipelineText(StringRef Text) {
std::vector<PipelineElement> ResultPipeline;
@@ -1303,7 +1315,7 @@ PassBuilder::parsePipelineText(StringRef Text) {
for (;;) {
std::vector<PipelineElement> &Pipeline = *PipelineStack.back();
size_t Pos = Text.find_first_of(",()");
- Pipeline.push_back({Text.substr(0, Pos), {}});
+ Pipeline.push_back({convertToNewPassName(Text.substr(0, Pos)), {}});
// If we have a single terminating name, we're done.
if (Pos == Text.npos)
>From 48fc88e69dbe3d3e80f425a0a798721d0069d106 Mon Sep 17 00:00:00 2001
From: PaperChalice <29250197+paperchalice at users.noreply.github.com>
Date: Wed, 6 Dec 2023 13:51:32 +0800
Subject: [PATCH 02/10] [Pass] Rename `loweratomic` -> `lower-atomic`
---
llvm/docs/Passes.rst | 4 ++--
llvm/lib/Passes/PassRegistry.def | 2 +-
llvm/lib/Transforms/Scalar/LowerAtomicPass.cpp | 2 +-
llvm/test/Feature/optnone-opt.ll | 2 +-
llvm/test/ThinLTO/X86/cache-config.ll | 2 +-
llvm/test/Transforms/LowerAtomic/atomic-load.ll | 2 +-
llvm/test/Transforms/LowerAtomic/atomic-swap.ll | 2 +-
llvm/test/Transforms/LowerAtomic/barrier.ll | 2 +-
llvm/test/tools/llvm-lto2/X86/pipeline.ll | 4 ++--
9 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/llvm/docs/Passes.rst b/llvm/docs/Passes.rst
index 46ca56df8f24c..a13bcc1c84788 100644
--- a/llvm/docs/Passes.rst
+++ b/llvm/docs/Passes.rst
@@ -728,8 +728,8 @@ wrapper functions that are registered as global constructors in
``llvm.global_ctors`` and which contain a call to ``__cxa_atexit`` to register
their destructor functions.
-``loweratomic``: Lower atomic intrinsics to non-atomic form
------------------------------------------------------------
+``lower-atomic``: Lower atomic intrinsics to non-atomic form
+------------------------------------------------------------
This pass lowers atomic intrinsics to non-atomic form for use in a known
non-preemptible environment.
diff --git a/llvm/lib/Passes/PassRegistry.def b/llvm/lib/Passes/PassRegistry.def
index 37c0d6c29b429..fd0eb63838a6d 100644
--- a/llvm/lib/Passes/PassRegistry.def
+++ b/llvm/lib/Passes/PassRegistry.def
@@ -333,11 +333,11 @@ FUNCTION_PASS("loop-load-elim", LoopLoadEliminationPass())
FUNCTION_PASS("loop-simplify", LoopSimplifyPass())
FUNCTION_PASS("loop-sink", LoopSinkPass())
FUNCTION_PASS("loop-versioning", LoopVersioningPass())
+FUNCTION_PASS("lower-atomic", LowerAtomicPass())
FUNCTION_PASS("lower-constant-intrinsics", LowerConstantIntrinsicsPass())
FUNCTION_PASS("lower-expect", LowerExpectIntrinsicPass())
FUNCTION_PASS("lower-guard-intrinsic", LowerGuardIntrinsicPass())
FUNCTION_PASS("lower-widenable-condition", LowerWidenableConditionPass())
-FUNCTION_PASS("loweratomic", LowerAtomicPass())
FUNCTION_PASS("lowerinvoke", LowerInvokePass())
FUNCTION_PASS("lowerswitch", LowerSwitchPass())
FUNCTION_PASS("make-guards-explicit", MakeGuardsExplicitPass())
diff --git a/llvm/lib/Transforms/Scalar/LowerAtomicPass.cpp b/llvm/lib/Transforms/Scalar/LowerAtomicPass.cpp
index 6aba913005d05..b42d3b2bc09ad 100644
--- a/llvm/lib/Transforms/Scalar/LowerAtomicPass.cpp
+++ b/llvm/lib/Transforms/Scalar/LowerAtomicPass.cpp
@@ -20,7 +20,7 @@
#include "llvm/Transforms/Utils/LowerAtomic.h"
using namespace llvm;
-#define DEBUG_TYPE "loweratomic"
+#define DEBUG_TYPE "lower-atomic"
static bool LowerFenceInst(FenceInst *FI) {
FI->eraseFromParent();
diff --git a/llvm/test/Feature/optnone-opt.ll b/llvm/test/Feature/optnone-opt.ll
index fd713dab2995f..83ff946320f53 100644
--- a/llvm/test/Feature/optnone-opt.ll
+++ b/llvm/test/Feature/optnone-opt.ll
@@ -2,7 +2,7 @@
; RUN: opt -passes='default<O1>' -S -debug-pass-manager %s 2>&1 | FileCheck %s --check-prefix=NPM-O1
; RUN: opt -passes='default<O2>' -S -debug-pass-manager %s 2>&1 | FileCheck %s --check-prefix=NPM-O1 --check-prefix=NPM-O2O3
; RUN: opt -passes='default<O3>' -S -debug-pass-manager %s 2>&1 | FileCheck %s --check-prefix=NPM-O1 --check-prefix=NPM-O2O3
-; RUN: opt -passes='dce,gvn-hoist,loweratomic' -S -debug-pass-manager %s 2>&1 | FileCheck %s --check-prefix=NPM-MORE
+; RUN: opt -passes='dce,gvn-hoist,lower-atomic' -S -debug-pass-manager %s 2>&1 | FileCheck %s --check-prefix=NPM-MORE
; RUN: opt -passes='loop(indvars,licm,loop-deletion,loop-idiom,loop-instsimplify,loop-reduce,simple-loop-unswitch),loop-unroll' -S -debug-pass-manager %s 2>&1 | FileCheck %s --check-prefix=NPM-LOOP
; RUN: opt -passes='instsimplify,verify' -S -debug-pass-manager %s 2>&1 | FileCheck %s --check-prefix=NPM-REQUIRED
diff --git a/llvm/test/ThinLTO/X86/cache-config.ll b/llvm/test/ThinLTO/X86/cache-config.ll
index dfdb0aca0beb2..b261ead077b07 100644
--- a/llvm/test/ThinLTO/X86/cache-config.ll
+++ b/llvm/test/ThinLTO/X86/cache-config.ll
@@ -12,7 +12,7 @@
; RUN: llvm-lto2 run -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -code-model=large
; RUN: llvm-lto2 run -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -cg-opt-level=0
; RUN: llvm-lto2 run -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -O1
-; RUN: llvm-lto2 run -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -opt-pipeline=loweratomic
+; RUN: llvm-lto2 run -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -opt-pipeline=lower-atomic
; RUN: llvm-lto2 run -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -aa-pipeline=basic-aa
; RUN: llvm-lto2 run -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -override-triple=x86_64-unknown-linux-gnu
; RUN: llvm-lto2 run -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -default-triple=x86_64-unknown-linux-gnu
diff --git a/llvm/test/Transforms/LowerAtomic/atomic-load.ll b/llvm/test/Transforms/LowerAtomic/atomic-load.ll
index be9a8bad4692a..4ab8fbb86cb60 100644
--- a/llvm/test/Transforms/LowerAtomic/atomic-load.ll
+++ b/llvm/test/Transforms/LowerAtomic/atomic-load.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -passes=loweratomic -S | FileCheck %s
+; RUN: opt < %s -passes=lower-atomic -S | FileCheck %s
define i8 @add() {
; CHECK-LABEL: @add(
diff --git a/llvm/test/Transforms/LowerAtomic/atomic-swap.ll b/llvm/test/Transforms/LowerAtomic/atomic-swap.ll
index b253812cd5fbb..00ac8129fd0a0 100644
--- a/llvm/test/Transforms/LowerAtomic/atomic-swap.ll
+++ b/llvm/test/Transforms/LowerAtomic/atomic-swap.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -passes=loweratomic -S | FileCheck %s
+; RUN: opt < %s -passes=lower-atomic -S | FileCheck %s
define i8 @cmpswap() {
; CHECK-LABEL: @cmpswap(
diff --git a/llvm/test/Transforms/LowerAtomic/barrier.ll b/llvm/test/Transforms/LowerAtomic/barrier.ll
index b96928bce9376..71a85d05fefd5 100644
--- a/llvm/test/Transforms/LowerAtomic/barrier.ll
+++ b/llvm/test/Transforms/LowerAtomic/barrier.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -passes=loweratomic -S | FileCheck %s
+; RUN: opt < %s -passes=lower-atomic -S | FileCheck %s
define void @barrier() {
; CHECK-LABEL: @barrier(
diff --git a/llvm/test/tools/llvm-lto2/X86/pipeline.ll b/llvm/test/tools/llvm-lto2/X86/pipeline.ll
index 9896cf4da2a40..93f30d0ee61bc 100644
--- a/llvm/test/tools/llvm-lto2/X86/pipeline.ll
+++ b/llvm/test/tools/llvm-lto2/X86/pipeline.ll
@@ -7,7 +7,7 @@
; Try a custom pipeline
; RUN: llvm-lto2 run %t1.bc -o %t.o -save-temps \
-; RUN: -r %t1.bc,patatino,px -opt-pipeline loweratomic \
+; RUN: -r %t1.bc,patatino,px -opt-pipeline lower-atomic \
; RUN: -aa-pipeline basic-aa
; RUN: llvm-dis < %t.o.0.4.opt.bc | FileCheck %s --check-prefix=CUSTOM
@@ -36,7 +36,7 @@ define void @patatino() {
; RUN: not --crash llvm-lto2 run %t1.bc -o %t.o \
; RUN: -r %t1.bc,patatino,px -aa-pipeline patatino \
-; RUN: -opt-pipeline loweratomic 2>&1 | \
+; RUN: -opt-pipeline lower-atomic 2>&1 | \
; RUN: FileCheck %s --check-prefix=AAERR
; AAERR: LLVM ERROR: unable to parse AA pipeline description 'patatino': unknown alias analysis name 'patatino'
>From 508b20d716081e254764bf92e57eb9d2d6756878 Mon Sep 17 00:00:00 2001
From: PaperChalice <29250197+paperchalice at users.noreply.github.com>
Date: Wed, 6 Dec 2023 13:54:17 +0800
Subject: [PATCH 03/10] [Pass] Rename `lowerinvoke` -> `lower-invoke`
---
llvm/docs/Passes.rst | 4 ++--
llvm/include/llvm/CodeGen/MachinePassRegistry.def | 2 +-
llvm/lib/Passes/PassBuilder.cpp | 3 ++-
llvm/lib/Passes/PassRegistry.def | 2 +-
llvm/lib/Transforms/Utils/LowerInvoke.cpp | 2 +-
llvm/test/Transforms/LowerInvoke/2003-12-10-Crash.ll | 2 +-
llvm/test/Transforms/LowerInvoke/lowerinvoke.ll | 4 ++--
llvm/test/Transforms/Util/lowerinvoke-funclet.ll | 2 +-
8 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/llvm/docs/Passes.rst b/llvm/docs/Passes.rst
index a13bcc1c84788..531278190c157 100644
--- a/llvm/docs/Passes.rst
+++ b/llvm/docs/Passes.rst
@@ -739,8 +739,8 @@ this would require knowledge of the entire call graph of the program including
any libraries which may not be available in bitcode form); it simply lowers
every atomic intrinsic.
-``lowerinvoke``: Lower invokes to calls, for unwindless code generators
------------------------------------------------------------------------
+``lower-invoke``: Lower invokes to calls, for unwindless code generators
+------------------------------------------------------------------------
This transformation is designed for use by code generators which do not yet
support stack unwinding. This pass converts ``invoke`` instructions to
diff --git a/llvm/include/llvm/CodeGen/MachinePassRegistry.def b/llvm/include/llvm/CodeGen/MachinePassRegistry.def
index 4c6706cf42532..8a19ac91ad2fe 100644
--- a/llvm/include/llvm/CodeGen/MachinePassRegistry.def
+++ b/llvm/include/llvm/CodeGen/MachinePassRegistry.def
@@ -44,7 +44,7 @@ FUNCTION_PASS("expand-large-fp-convert", ExpandLargeFpConvertPass, ())
FUNCTION_PASS("expand-reductions", ExpandReductionsPass, ())
FUNCTION_PASS("expandvp", ExpandVectorPredicationPass, ())
FUNCTION_PASS("lower-constant-intrinsics", LowerConstantIntrinsicsPass, ())
-FUNCTION_PASS("lowerinvoke", LowerInvokePass, ())
+FUNCTION_PASS("lower-invoke", LowerInvokePass, ())
FUNCTION_PASS("mergeicmps", MergeICmpsPass, ())
FUNCTION_PASS("partially-inline-libcalls", PartiallyInlineLibCallsPass, ())
FUNCTION_PASS("post-inline-ee-instrument", EntryExitInstrumenterPass, (true))
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index 0780e04abd9df..775608b064cab 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -1295,7 +1295,8 @@ static bool isLoopPassName(StringRef Name, CallbacksT &Callbacks,
}
static StringRef convertToNewPassName(StringRef OldName) {
- static StringMap<StringRef> NameMap = {{"loweratomic", "lower-atomic"}};
+ static StringMap<StringRef> NameMap = {{"loweratomic", "lower-atomic"},
+ {"lowerinvoke", "lower-invoke"}};
if (auto I = NameMap.find(OldName); I != NameMap.end()) {
auto NewName = I->second;
diff --git a/llvm/lib/Passes/PassRegistry.def b/llvm/lib/Passes/PassRegistry.def
index fd0eb63838a6d..bc59cf1a1d1ef 100644
--- a/llvm/lib/Passes/PassRegistry.def
+++ b/llvm/lib/Passes/PassRegistry.def
@@ -337,8 +337,8 @@ FUNCTION_PASS("lower-atomic", LowerAtomicPass())
FUNCTION_PASS("lower-constant-intrinsics", LowerConstantIntrinsicsPass())
FUNCTION_PASS("lower-expect", LowerExpectIntrinsicPass())
FUNCTION_PASS("lower-guard-intrinsic", LowerGuardIntrinsicPass())
+FUNCTION_PASS("lower-invoke", LowerInvokePass())
FUNCTION_PASS("lower-widenable-condition", LowerWidenableConditionPass())
-FUNCTION_PASS("lowerinvoke", LowerInvokePass())
FUNCTION_PASS("lowerswitch", LowerSwitchPass())
FUNCTION_PASS("make-guards-explicit", MakeGuardsExplicitPass())
FUNCTION_PASS("mem2reg", PromotePass())
diff --git a/llvm/lib/Transforms/Utils/LowerInvoke.cpp b/llvm/lib/Transforms/Utils/LowerInvoke.cpp
index 6d788857c1ea2..22ff3c2e5848f 100644
--- a/llvm/lib/Transforms/Utils/LowerInvoke.cpp
+++ b/llvm/lib/Transforms/Utils/LowerInvoke.cpp
@@ -22,7 +22,7 @@
#include "llvm/Transforms/Utils.h"
using namespace llvm;
-#define DEBUG_TYPE "lowerinvoke"
+#define DEBUG_TYPE "lower-invoke"
STATISTIC(NumInvokes, "Number of invokes replaced");
diff --git a/llvm/test/Transforms/LowerInvoke/2003-12-10-Crash.ll b/llvm/test/Transforms/LowerInvoke/2003-12-10-Crash.ll
index bb0d2ce2099cd..d28107257e26d 100644
--- a/llvm/test/Transforms/LowerInvoke/2003-12-10-Crash.ll
+++ b/llvm/test/Transforms/LowerInvoke/2003-12-10-Crash.ll
@@ -1,6 +1,6 @@
; This testcase was reduced from Shootout-C++/reversefile.cpp by bugpoint
-; RUN: opt < %s -passes=lowerinvoke -disable-output
+; RUN: opt < %s -passes=lower-invoke -disable-output
declare void @baz()
diff --git a/llvm/test/Transforms/LowerInvoke/lowerinvoke.ll b/llvm/test/Transforms/LowerInvoke/lowerinvoke.ll
index c245c9a995fcb..0ffc27ee40f94 100644
--- a/llvm/test/Transforms/LowerInvoke/lowerinvoke.ll
+++ b/llvm/test/Transforms/LowerInvoke/lowerinvoke.ll
@@ -1,5 +1,5 @@
-; RUN: opt < %s -passes=lowerinvoke -S | FileCheck %s
-; RUN: opt < %s -passes='lowerinvoke' -S | FileCheck %s
+; RUN: opt < %s -passes=lower-invoke -S | FileCheck %s
+; RUN: opt < %s -passes='lower-invoke' -S | FileCheck %s
declare i32 @external_func(i64 %arg)
diff --git a/llvm/test/Transforms/Util/lowerinvoke-funclet.ll b/llvm/test/Transforms/Util/lowerinvoke-funclet.ll
index 0d0f8304b3139..edb78be2c05bb 100644
--- a/llvm/test/Transforms/Util/lowerinvoke-funclet.ll
+++ b/llvm/test/Transforms/Util/lowerinvoke-funclet.ll
@@ -1,4 +1,4 @@
-; RUN: opt -passes=lowerinvoke -S < %s | FileCheck %s
+; RUN: opt -passes=lower-invoke -S < %s | FileCheck %s
; Test if invoke instructions that have a funclet operand bundle can be lowered.
>From 51331ee405b0ec96c9ca952384ec26ce30300294 Mon Sep 17 00:00:00 2001
From: PaperChalice <29250197+paperchalice at users.noreply.github.com>
Date: Wed, 6 Dec 2023 13:59:24 +0800
Subject: [PATCH 04/10] [Pass] Rename `lowerswitch` -> `lower-switch`
---
llvm/docs/Passes.rst | 4 ++--
llvm/lib/Passes/PassBuilder.cpp | 3 ++-
llvm/lib/Passes/PassRegistry.def | 2 +-
llvm/test/CodeGen/AMDGPU/multi-divergent-exit-region.ll | 4 ++--
llvm/test/CodeGen/AMDGPU/multilevel-break.ll | 2 +-
.../test/CodeGen/AMDGPU/si-unify-exit-return-unreachable.ll | 2 +-
llvm/test/Transforms/FixIrreducible/switch.ll | 2 +-
llvm/test/Transforms/LowerSwitch/2003-05-01-PHIProblem.ll | 2 +-
llvm/test/Transforms/LowerSwitch/2003-08-23-EmptySwitch.ll | 2 +-
.../LowerSwitch/2004-03-13-SwitchIsDefaultCrash.ll | 2 +-
.../LowerSwitch/2014-06-10-SwitchContiguousOpt.ll | 2 +-
.../LowerSwitch/2014-06-11-SwitchDefaultUnreachableOpt.ll | 2 +-
llvm/test/Transforms/LowerSwitch/2014-06-23-PHIlowering.ll | 2 +-
.../LowerSwitch/condition-phi-unreachable-default.ll | 4 ++--
.../Transforms/LowerSwitch/delete-default-block-crash.ll | 4 ++--
.../LowerSwitch/do-not-handle-impossible-values.ll | 2 +-
llvm/test/Transforms/LowerSwitch/feature.ll | 2 +-
.../LowerSwitch/fold-popular-case-to-unreachable-default.ll | 2 +-
llvm/test/Transforms/LowerSwitch/phi-in-dead-block.ll | 2 +-
llvm/test/Transforms/LowerSwitch/pr59316.ll | 2 +-
.../Transforms/StructurizeCFG/interleaved-loop-order.ll | 2 +-
llvm/test/Transforms/StructurizeCFG/switch.ll | 2 +-
.../UnifyFunctionExitNodes/unreachable-blocks-status.ll | 2 +-
llvm/test/Transforms/UnifyLoopExits/basic.ll | 2 +-
llvm/test/Transforms/UnifyLoopExits/nested.ll | 2 +-
llvm/test/Transforms/UnifyLoopExits/restore-ssa.ll | 2 +-
llvm/test/Transforms/UnifyLoopExits/switch.ll | 2 +-
llvm/test/Transforms/Util/lowerswitch.ll | 6 +++---
28 files changed, 35 insertions(+), 34 deletions(-)
diff --git a/llvm/docs/Passes.rst b/llvm/docs/Passes.rst
index 531278190c157..0d0353ed6b611 100644
--- a/llvm/docs/Passes.rst
+++ b/llvm/docs/Passes.rst
@@ -748,8 +748,8 @@ support stack unwinding. This pass converts ``invoke`` instructions to
become dead code (which can be removed by running the ``-simplifycfg`` pass
afterwards).
-``lowerswitch``: Lower ``SwitchInst``\ s to branches
-----------------------------------------------------
+``lower-switch``: Lower ``SwitchInst``\ s to branches
+-----------------------------------------------------
Rewrites switch instructions with a sequence of branches, which allows targets
to get away with not implementing the switch instruction until it is
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index 775608b064cab..46e3c636e4b97 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -1296,7 +1296,8 @@ static bool isLoopPassName(StringRef Name, CallbacksT &Callbacks,
static StringRef convertToNewPassName(StringRef OldName) {
static StringMap<StringRef> NameMap = {{"loweratomic", "lower-atomic"},
- {"lowerinvoke", "lower-invoke"}};
+ {"lowerinvoke", "lower-invoke"},
+ {"lowerswitch", "lower-switch"}};
if (auto I = NameMap.find(OldName); I != NameMap.end()) {
auto NewName = I->second;
diff --git a/llvm/lib/Passes/PassRegistry.def b/llvm/lib/Passes/PassRegistry.def
index bc59cf1a1d1ef..85814cd1edfaa 100644
--- a/llvm/lib/Passes/PassRegistry.def
+++ b/llvm/lib/Passes/PassRegistry.def
@@ -338,8 +338,8 @@ FUNCTION_PASS("lower-constant-intrinsics", LowerConstantIntrinsicsPass())
FUNCTION_PASS("lower-expect", LowerExpectIntrinsicPass())
FUNCTION_PASS("lower-guard-intrinsic", LowerGuardIntrinsicPass())
FUNCTION_PASS("lower-invoke", LowerInvokePass())
+FUNCTION_PASS("lower-switch", LowerSwitchPass())
FUNCTION_PASS("lower-widenable-condition", LowerWidenableConditionPass())
-FUNCTION_PASS("lowerswitch", LowerSwitchPass())
FUNCTION_PASS("make-guards-explicit", MakeGuardsExplicitPass())
FUNCTION_PASS("mem2reg", PromotePass())
FUNCTION_PASS("memcpyopt", MemCpyOptPass())
diff --git a/llvm/test/CodeGen/AMDGPU/multi-divergent-exit-region.ll b/llvm/test/CodeGen/AMDGPU/multi-divergent-exit-region.ll
index 0a68820f902a1..1c0b489946ccb 100644
--- a/llvm/test/CodeGen/AMDGPU/multi-divergent-exit-region.ll
+++ b/llvm/test/CodeGen/AMDGPU/multi-divergent-exit-region.ll
@@ -1,5 +1,5 @@
-; RUN: opt -mtriple=amdgcn-- -mcpu=gfx600 -S -lowerswitch -amdgpu-unify-divergent-exit-nodes -verify -structurizecfg -verify -si-annotate-control-flow -simplifycfg-require-and-preserve-domtree=1 %s | FileCheck -check-prefix=IR %s
-; RUN: opt -mtriple=amdgcn-- -mcpu=gfx1100 -mattr=-wavefrontsize32,+wavefrontsize64 -S -lowerswitch -amdgpu-unify-divergent-exit-nodes -verify -structurizecfg -verify -si-annotate-control-flow -simplifycfg-require-and-preserve-domtree=1 %s | FileCheck -check-prefix=IR %s
+; RUN: opt -mtriple=amdgcn-- -mcpu=gfx600 -S -lower-switch -amdgpu-unify-divergent-exit-nodes -verify -structurizecfg -verify -si-annotate-control-flow -simplifycfg-require-and-preserve-domtree=1 %s | FileCheck -check-prefix=IR %s
+; RUN: opt -mtriple=amdgcn-- -mcpu=gfx1100 -mattr=-wavefrontsize32,+wavefrontsize64 -S -lower-switch -amdgpu-unify-divergent-exit-nodes -verify -structurizecfg -verify -si-annotate-control-flow -simplifycfg-require-and-preserve-domtree=1 %s | FileCheck -check-prefix=IR %s
; RUN: llc -march=amdgcn -verify-machineinstrs -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck -check-prefix=GCN %s
; Add an extra verifier runs. There were some cases where invalid IR
diff --git a/llvm/test/CodeGen/AMDGPU/multilevel-break.ll b/llvm/test/CodeGen/AMDGPU/multilevel-break.ll
index 8d2a312b34632..073c5214fa041 100644
--- a/llvm/test/CodeGen/AMDGPU/multilevel-break.ll
+++ b/llvm/test/CodeGen/AMDGPU/multilevel-break.ll
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt -S -mtriple=amdgcn-- -lowerswitch -structurizecfg -si-annotate-control-flow < %s | FileCheck -check-prefix=OPT %s
+; RUN: opt -S -mtriple=amdgcn-- -lower-switch -structurizecfg -si-annotate-control-flow < %s | FileCheck -check-prefix=OPT %s
; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
; Ensure two if.break calls, for both the inner and outer loops
diff --git a/llvm/test/CodeGen/AMDGPU/si-unify-exit-return-unreachable.ll b/llvm/test/CodeGen/AMDGPU/si-unify-exit-return-unreachable.ll
index 1eef7b967f6d9..dfa73cc068d31 100644
--- a/llvm/test/CodeGen/AMDGPU/si-unify-exit-return-unreachable.ll
+++ b/llvm/test/CodeGen/AMDGPU/si-unify-exit-return-unreachable.ll
@@ -1,7 +1,7 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=amdgcn-amd-amdhsa -verify-machineinstrs %s -o - | FileCheck -check-prefix=GCN %s
-; RUN: opt -mtriple=amdgcn-amd-amdhsa -lowerswitch -amdgpu-unify-divergent-exit-nodes -verify -structurizecfg -verify -si-annotate-control-flow -verify -S %s -o - | FileCheck -check-prefix=IR %s
+; RUN: opt -mtriple=amdgcn-amd-amdhsa -lower-switch -amdgpu-unify-divergent-exit-nodes -verify -structurizecfg -verify -si-annotate-control-flow -verify -S %s -o - | FileCheck -check-prefix=IR %s
; A test with a divergent unreachable block and uniform return block. The
; compiler needs to create a regions that includes them so that
diff --git a/llvm/test/Transforms/FixIrreducible/switch.ll b/llvm/test/Transforms/FixIrreducible/switch.ll
index 57b92c08ed311..27b9f9bf3b53b 100644
--- a/llvm/test/Transforms/FixIrreducible/switch.ll
+++ b/llvm/test/Transforms/FixIrreducible/switch.ll
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -passes='lowerswitch,fix-irreducible' -S | FileCheck %s
+; RUN: opt < %s -passes='lower-switch,fix-irreducible' -S | FileCheck %s
define void @loop_1(i32 %Value, i1 %PredEntry, i1 %PredD) {
; CHECK-LABEL: @loop_1(
diff --git a/llvm/test/Transforms/LowerSwitch/2003-05-01-PHIProblem.ll b/llvm/test/Transforms/LowerSwitch/2003-05-01-PHIProblem.ll
index fab8ecafb8908..f149f37a20830 100644
--- a/llvm/test/Transforms/LowerSwitch/2003-05-01-PHIProblem.ll
+++ b/llvm/test/Transforms/LowerSwitch/2003-05-01-PHIProblem.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -passes=lowerswitch
+; RUN: opt < %s -passes=lower-switch
define void @child(i32 %ct.1) {
entry:
diff --git a/llvm/test/Transforms/LowerSwitch/2003-08-23-EmptySwitch.ll b/llvm/test/Transforms/LowerSwitch/2003-08-23-EmptySwitch.ll
index f5889479c129b..fbf2198e005ee 100644
--- a/llvm/test/Transforms/LowerSwitch/2003-08-23-EmptySwitch.ll
+++ b/llvm/test/Transforms/LowerSwitch/2003-08-23-EmptySwitch.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -passes=lowerswitch
+; RUN: opt < %s -passes=lower-switch
define void @test() {
switch i32 0, label %Next [
diff --git a/llvm/test/Transforms/LowerSwitch/2004-03-13-SwitchIsDefaultCrash.ll b/llvm/test/Transforms/LowerSwitch/2004-03-13-SwitchIsDefaultCrash.ll
index 069a5558eee87..dff375935f319 100644
--- a/llvm/test/Transforms/LowerSwitch/2004-03-13-SwitchIsDefaultCrash.ll
+++ b/llvm/test/Transforms/LowerSwitch/2004-03-13-SwitchIsDefaultCrash.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -passes=lowerswitch -disable-output
+; RUN: opt < %s -passes=lower-switch -disable-output
define void @solve() {
entry:
diff --git a/llvm/test/Transforms/LowerSwitch/2014-06-10-SwitchContiguousOpt.ll b/llvm/test/Transforms/LowerSwitch/2014-06-10-SwitchContiguousOpt.ll
index 94ebd13e71c23..c8006087a1fde 100644
--- a/llvm/test/Transforms/LowerSwitch/2014-06-10-SwitchContiguousOpt.ll
+++ b/llvm/test/Transforms/LowerSwitch/2014-06-10-SwitchContiguousOpt.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -passes=lowerswitch -S | FileCheck %s
+; RUN: opt < %s -passes=lower-switch -S | FileCheck %s
; CHECK-NOT: icmp eq i32 %0, 1
define i32 @foo(i32 %a) #0 {
diff --git a/llvm/test/Transforms/LowerSwitch/2014-06-11-SwitchDefaultUnreachableOpt.ll b/llvm/test/Transforms/LowerSwitch/2014-06-11-SwitchDefaultUnreachableOpt.ll
index 5380010b1e7b5..118f0ff5c19df 100644
--- a/llvm/test/Transforms/LowerSwitch/2014-06-11-SwitchDefaultUnreachableOpt.ll
+++ b/llvm/test/Transforms/LowerSwitch/2014-06-11-SwitchDefaultUnreachableOpt.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -passes=lowerswitch -S | FileCheck %s
+; RUN: opt < %s -passes=lower-switch -S | FileCheck %s
;
; The switch is lowered with a single icmp.
; CHECK: icmp
diff --git a/llvm/test/Transforms/LowerSwitch/2014-06-23-PHIlowering.ll b/llvm/test/Transforms/LowerSwitch/2014-06-23-PHIlowering.ll
index 0c583526fc10b..80d9441eebdc7 100644
--- a/llvm/test/Transforms/LowerSwitch/2014-06-23-PHIlowering.ll
+++ b/llvm/test/Transforms/LowerSwitch/2014-06-23-PHIlowering.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -passes=lowerswitch -S | FileCheck %s
+; RUN: opt < %s -passes=lower-switch -S | FileCheck %s
define i32 @test(i32 %arg) #0 {
; CHECK-LABEL: @test
diff --git a/llvm/test/Transforms/LowerSwitch/condition-phi-unreachable-default.ll b/llvm/test/Transforms/LowerSwitch/condition-phi-unreachable-default.ll
index 18f864ecf3e63..09cb5b0918c91 100644
--- a/llvm/test/Transforms/LowerSwitch/condition-phi-unreachable-default.ll
+++ b/llvm/test/Transforms/LowerSwitch/condition-phi-unreachable-default.ll
@@ -1,6 +1,6 @@
-; RUN: opt < %s -passes=lowerswitch -S | FileCheck %s
+; RUN: opt < %s -passes=lower-switch -S | FileCheck %s
-; This test verifies -lowerswitch does not crash when an removing an
+; This test verifies -lower-switch does not crash when an removing an
; unreachable default branch causes a PHI node used as the switch
; condition to be erased.
diff --git a/llvm/test/Transforms/LowerSwitch/delete-default-block-crash.ll b/llvm/test/Transforms/LowerSwitch/delete-default-block-crash.ll
index 59b55aafa6941..55f43efcea42a 100644
--- a/llvm/test/Transforms/LowerSwitch/delete-default-block-crash.ll
+++ b/llvm/test/Transforms/LowerSwitch/delete-default-block-crash.ll
@@ -1,6 +1,6 @@
-; RUN: opt < %s -passes=lowerswitch -disable-output
+; RUN: opt < %s -passes=lower-switch -disable-output
-; This test verify -lowerswitch does not crash after deleting the default block.
+; This test verify -lower-switch does not crash after deleting the default block.
declare i32 @f(i32)
diff --git a/llvm/test/Transforms/LowerSwitch/do-not-handle-impossible-values.ll b/llvm/test/Transforms/LowerSwitch/do-not-handle-impossible-values.ll
index 771d46fd42823..64ef582989066 100644
--- a/llvm/test/Transforms/LowerSwitch/do-not-handle-impossible-values.ll
+++ b/llvm/test/Transforms/LowerSwitch/do-not-handle-impossible-values.ll
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -passes=lowerswitch -S | FileCheck %s
+; RUN: opt < %s -passes=lower-switch -S | FileCheck %s
; Check that we do not generate redundant comparisons that would have results
; known at compile time due to limited range of the value being switch'ed over.
diff --git a/llvm/test/Transforms/LowerSwitch/feature.ll b/llvm/test/Transforms/LowerSwitch/feature.ll
index 8e39c53181701..5574c4d897e77 100644
--- a/llvm/test/Transforms/LowerSwitch/feature.ll
+++ b/llvm/test/Transforms/LowerSwitch/feature.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -passes=lowerswitch -S | FileCheck %s
+; RUN: opt < %s -passes=lower-switch -S | FileCheck %s
; We have switch on input.
; On output we should got binary comparison tree. Check that all is fine.
diff --git a/llvm/test/Transforms/LowerSwitch/fold-popular-case-to-unreachable-default.ll b/llvm/test/Transforms/LowerSwitch/fold-popular-case-to-unreachable-default.ll
index 9d7527eea28a3..9d9d93c085178 100644
--- a/llvm/test/Transforms/LowerSwitch/fold-popular-case-to-unreachable-default.ll
+++ b/llvm/test/Transforms/LowerSwitch/fold-popular-case-to-unreachable-default.ll
@@ -1,4 +1,4 @@
-; RUN: opt %s -passes=lowerswitch -S | FileCheck %s
+; RUN: opt %s -passes=lower-switch -S | FileCheck %s
define void @foo(i32 %x, ptr %p) {
; Cases 2 and 4 are removed and become the new default case.
diff --git a/llvm/test/Transforms/LowerSwitch/phi-in-dead-block.ll b/llvm/test/Transforms/LowerSwitch/phi-in-dead-block.ll
index ff94ff80ea5b0..952f586293cd5 100644
--- a/llvm/test/Transforms/LowerSwitch/phi-in-dead-block.ll
+++ b/llvm/test/Transforms/LowerSwitch/phi-in-dead-block.ll
@@ -1,4 +1,4 @@
-; RUN: opt -S -passes=lowerswitch %s | FileCheck %s
+; RUN: opt -S -passes=lower-switch %s | FileCheck %s
; CHECK-LABEL: @phi_in_dead_block(
; CHECK-NOT: switch
diff --git a/llvm/test/Transforms/LowerSwitch/pr59316.ll b/llvm/test/Transforms/LowerSwitch/pr59316.ll
index 0616ace672965..002325441031c 100644
--- a/llvm/test/Transforms/LowerSwitch/pr59316.ll
+++ b/llvm/test/Transforms/LowerSwitch/pr59316.ll
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -passes=lowerswitch -S | FileCheck %s
+; RUN: opt < %s -passes=lower-switch -S | FileCheck %s
define i64 @f(i1 %bool, i128 %i128) {
; CHECK-LABEL: @f(
diff --git a/llvm/test/Transforms/StructurizeCFG/interleaved-loop-order.ll b/llvm/test/Transforms/StructurizeCFG/interleaved-loop-order.ll
index 3ca70dab27193..9a865ca2c1e07 100644
--- a/llvm/test/Transforms/StructurizeCFG/interleaved-loop-order.ll
+++ b/llvm/test/Transforms/StructurizeCFG/interleaved-loop-order.ll
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt -S -lowerswitch -structurizecfg %s -o - | FileCheck %s
+; RUN: opt -S -lower-switch -structurizecfg %s -o - | FileCheck %s
; This test have an outer loop containing an inner loop,
; for which there is an interleaved post-order traversal.
diff --git a/llvm/test/Transforms/StructurizeCFG/switch.ll b/llvm/test/Transforms/StructurizeCFG/switch.ll
index 153b6d1914e67..91818850a3630 100644
--- a/llvm/test/Transforms/StructurizeCFG/switch.ll
+++ b/llvm/test/Transforms/StructurizeCFG/switch.ll
@@ -1,4 +1,4 @@
-; RUN: opt -S -passes='lowerswitch,structurizecfg' %s -o - | FileCheck %s
+; RUN: opt -S -passes='lower-switch,structurizecfg' %s -o - | FileCheck %s
; The structurizecfg pass cannot handle switch instructions, so we need to
; make sure the lower switch pass is always run before structurizecfg.
diff --git a/llvm/test/Transforms/UnifyFunctionExitNodes/unreachable-blocks-status.ll b/llvm/test/Transforms/UnifyFunctionExitNodes/unreachable-blocks-status.ll
index dbbb5ae91a01d..a6832c79dad43 100644
--- a/llvm/test/Transforms/UnifyFunctionExitNodes/unreachable-blocks-status.ll
+++ b/llvm/test/Transforms/UnifyFunctionExitNodes/unreachable-blocks-status.ll
@@ -1,4 +1,4 @@
-; RUN: opt -passes='break-crit-edges,lowerswitch,mergereturn' -S < %s | FileCheck %s
+; RUN: opt -passes='break-crit-edges,lower-switch,mergereturn' -S < %s | FileCheck %s
; The pass did previously not report the correct Modified status in the case
; where a function had at most one return block, and an unified unreachable
diff --git a/llvm/test/Transforms/UnifyLoopExits/basic.ll b/llvm/test/Transforms/UnifyLoopExits/basic.ll
index 942ca6f773fbc..ccd15d4e6b943 100644
--- a/llvm/test/Transforms/UnifyLoopExits/basic.ll
+++ b/llvm/test/Transforms/UnifyLoopExits/basic.ll
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -passes='lowerswitch,unify-loop-exits' -S | FileCheck %s
+; RUN: opt < %s -passes='lower-switch,unify-loop-exits' -S | FileCheck %s
define void @loop_1(i1 %PredEntry, i1 %PredB, i1 %PredC, i1 %PredD) {
; CHECK-LABEL: @loop_1(
diff --git a/llvm/test/Transforms/UnifyLoopExits/nested.ll b/llvm/test/Transforms/UnifyLoopExits/nested.ll
index 9973aa305cdf1..b02e353d18639 100644
--- a/llvm/test/Transforms/UnifyLoopExits/nested.ll
+++ b/llvm/test/Transforms/UnifyLoopExits/nested.ll
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -passes='lowerswitch,unify-loop-exits' -S | FileCheck %s
+; RUN: opt < %s -passes='lower-switch,unify-loop-exits' -S | FileCheck %s
define void @nested(i1 %PredB3, i1 %PredB4, i1 %PredA4, i1 %PredA3, i32 %X, i32 %Y, i32 %Z) {
; CHECK-LABEL: @nested(
diff --git a/llvm/test/Transforms/UnifyLoopExits/restore-ssa.ll b/llvm/test/Transforms/UnifyLoopExits/restore-ssa.ll
index 16db74aba4674..33dbc1be89ec5 100644
--- a/llvm/test/Transforms/UnifyLoopExits/restore-ssa.ll
+++ b/llvm/test/Transforms/UnifyLoopExits/restore-ssa.ll
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -passes='lowerswitch,unify-loop-exits' -S | FileCheck %s
+; RUN: opt < %s -passes='lower-switch,unify-loop-exits' -S | FileCheck %s
; Loop consists of A and B:
; - A is the header
diff --git a/llvm/test/Transforms/UnifyLoopExits/switch.ll b/llvm/test/Transforms/UnifyLoopExits/switch.ll
index 1fbf758c45f33..887a6f5d08e9b 100644
--- a/llvm/test/Transforms/UnifyLoopExits/switch.ll
+++ b/llvm/test/Transforms/UnifyLoopExits/switch.ll
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -passes='lowerswitch,unify-loop-exits' -S | FileCheck %s
+; RUN: opt < %s -passes='lower-switch,unify-loop-exits' -S | FileCheck %s
define void @loop_1(i32 %Value, i1 %PredEntry, i1 %PredD) {
; CHECK-LABEL: @loop_1(
diff --git a/llvm/test/Transforms/Util/lowerswitch.ll b/llvm/test/Transforms/Util/lowerswitch.ll
index 73343fbcb962a..b5fb214cfcadf 100644
--- a/llvm/test/Transforms/Util/lowerswitch.ll
+++ b/llvm/test/Transforms/Util/lowerswitch.ll
@@ -1,4 +1,4 @@
-; RUN: opt -passes=lowerswitch -S < %s | FileCheck %s
+; RUN: opt -passes=lower-switch -S < %s | FileCheck %s
; Test that we don't crash and have a different basic block for each incoming edge.
define void @test0(i32 %mode) {
@@ -31,7 +31,7 @@ BB3:
br label %BB2
}
-; Test switch cases that are merged into a single case during lowerswitch
+; Test switch cases that are merged into a single case during lower-switch
; (take 84 and 85 below) - check that the number of incoming phi values match
; the number of branches.
define void @test1(i32 %mode) {
@@ -198,7 +198,7 @@ define void @test2(i32 %mode, i1 %c1, i1 %c2, i1 %c3, i1 %c4, i1 %c5, i1 %c6) {
}
; Test that the PHI node in for.cond should have one entry for each predecessor
-; of its parent basic block after lowerswitch merged several cases into a new
+; of its parent basic block after lower-switch merged several cases into a new
; default block.
define void @test3(i32 %mode, i1 %c1, i1 %c2) {
; CHECK-LABEL: @test3
>From 497c0c188c5d87e7fd3de45a1e510ca2e48c71d4 Mon Sep 17 00:00:00 2001
From: PaperChalice <29250197+paperchalice at users.noreply.github.com>
Date: Wed, 6 Dec 2023 14:03:44 +0800
Subject: [PATCH 05/10] [Pass] Rename `callbrprepare` -> `callbr-prepare`
---
llvm/include/llvm/CodeGen/MachinePassRegistry.def | 2 +-
llvm/lib/CodeGen/CallBrPrepare.cpp | 6 +++---
llvm/lib/Passes/PassBuilder.cpp | 3 ++-
llvm/lib/Passes/PassRegistry.def | 2 +-
llvm/test/CodeGen/AArch64/callbr-prepare.ll | 2 +-
5 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/llvm/include/llvm/CodeGen/MachinePassRegistry.def b/llvm/include/llvm/CodeGen/MachinePassRegistry.def
index 8a19ac91ad2fe..b9dd2c1362774 100644
--- a/llvm/include/llvm/CodeGen/MachinePassRegistry.def
+++ b/llvm/include/llvm/CodeGen/MachinePassRegistry.def
@@ -36,7 +36,7 @@ FUNCTION_ANALYSIS("targetir", TargetIRAnalysis,
#ifndef FUNCTION_PASS
#define FUNCTION_PASS(NAME, PASS_NAME, CONSTRUCTOR)
#endif
-FUNCTION_PASS("callbrprepare", CallBrPreparePass, ())
+FUNCTION_PASS("callbr-prepare", CallBrPreparePass, ())
FUNCTION_PASS("consthoist", ConstantHoistingPass, ())
FUNCTION_PASS("ee-instrument", EntryExitInstrumenterPass, (false))
FUNCTION_PASS("expand-large-div-rem", ExpandLargeDivRemPass, ())
diff --git a/llvm/lib/CodeGen/CallBrPrepare.cpp b/llvm/lib/CodeGen/CallBrPrepare.cpp
index fddc4d74b2da9..0478c08bb2efd 100644
--- a/llvm/lib/CodeGen/CallBrPrepare.cpp
+++ b/llvm/lib/CodeGen/CallBrPrepare.cpp
@@ -52,7 +52,7 @@
using namespace llvm;
-#define DEBUG_TYPE "callbrprepare"
+#define DEBUG_TYPE "callbr-prepare"
static bool SplitCriticalEdges(ArrayRef<CallBrInst *> CBRs, DominatorTree &DT);
static bool InsertIntrinsicCalls(ArrayRef<CallBrInst *> CBRs,
@@ -94,9 +94,9 @@ PreservedAnalyses CallBrPreparePass::run(Function &Fn,
}
char CallBrPrepare::ID = 0;
-INITIALIZE_PASS_BEGIN(CallBrPrepare, DEBUG_TYPE, "Prepare callbr", false, false)
+INITIALIZE_PASS_BEGIN(CallBrPrepare, "callbrprepare", "Prepare callbr", false, false)
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
-INITIALIZE_PASS_END(CallBrPrepare, DEBUG_TYPE, "Prepare callbr", false, false)
+INITIALIZE_PASS_END(CallBrPrepare, "callbrprepare", "Prepare callbr", false, false)
FunctionPass *llvm::createCallBrPass() { return new CallBrPrepare(); }
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index 46e3c636e4b97..71067d3ee286e 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -1295,7 +1295,8 @@ static bool isLoopPassName(StringRef Name, CallbacksT &Callbacks,
}
static StringRef convertToNewPassName(StringRef OldName) {
- static StringMap<StringRef> NameMap = {{"loweratomic", "lower-atomic"},
+ static StringMap<StringRef> NameMap = {{"callbr-prepare", "callbr-prepare"},
+ {"loweratomic", "lower-atomic"},
{"lowerinvoke", "lower-invoke"},
{"lowerswitch", "lower-switch"}};
diff --git a/llvm/lib/Passes/PassRegistry.def b/llvm/lib/Passes/PassRegistry.def
index 85814cd1edfaa..7c07a7332a590 100644
--- a/llvm/lib/Passes/PassRegistry.def
+++ b/llvm/lib/Passes/PassRegistry.def
@@ -283,7 +283,7 @@ FUNCTION_PASS("assume-simplify", AssumeSimplifyPass())
FUNCTION_PASS("bdce", BDCEPass())
FUNCTION_PASS("bounds-checking", BoundsCheckingPass())
FUNCTION_PASS("break-crit-edges", BreakCriticalEdgesPass())
-FUNCTION_PASS("callbrprepare", CallBrPreparePass())
+FUNCTION_PASS("callbr-prepare", CallBrPreparePass())
FUNCTION_PASS("callsite-splitting", CallSiteSplittingPass())
FUNCTION_PASS("chr", ControlHeightReductionPass())
FUNCTION_PASS("consthoist", ConstantHoistingPass())
diff --git a/llvm/test/CodeGen/AArch64/callbr-prepare.ll b/llvm/test/CodeGen/AArch64/callbr-prepare.ll
index 701355793d1ca..afe18ca8b7c50 100644
--- a/llvm/test/CodeGen/AArch64/callbr-prepare.ll
+++ b/llvm/test/CodeGen/AArch64/callbr-prepare.ll
@@ -1,6 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt %s -callbrprepare -S -o - | FileCheck %s
-; RUN: opt %s -passes=callbrprepare -S -o - | FileCheck %s
+; RUN: opt %s -passes=callbr-prepare -S -o - | FileCheck %s
define i32 @test0() {
; CHECK-LABEL: @test0(
>From 86340b663aa0069b82fbfff5faf6f6883ceb5654 Mon Sep 17 00:00:00 2001
From: PaperChalice <29250197+paperchalice at users.noreply.github.com>
Date: Wed, 6 Dec 2023 14:09:09 +0800
Subject: [PATCH 06/10] [Pass] Rename `dwarfehprepare` -> `dwarf-eh-prepare`
---
llvm/include/llvm/CodeGen/MachinePassRegistry.def | 2 +-
llvm/lib/Passes/PassBuilder.cpp | 1 +
llvm/lib/Passes/PassRegistry.def | 2 +-
llvm/test/CodeGen/X86/dwarf-eh-prepare-dbg.ll | 2 +-
llvm/test/CodeGen/X86/dwarf-eh-prepare.ll | 2 +-
llvm/test/CodeGen/X86/dwarf_eh_resume.ll | 2 +-
6 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/llvm/include/llvm/CodeGen/MachinePassRegistry.def b/llvm/include/llvm/CodeGen/MachinePassRegistry.def
index b9dd2c1362774..5cefbb099aae4 100644
--- a/llvm/include/llvm/CodeGen/MachinePassRegistry.def
+++ b/llvm/include/llvm/CodeGen/MachinePassRegistry.def
@@ -121,7 +121,7 @@ DUMMY_FUNCTION_PASS("atomic-expand", AtomicExpandPass, ())
DUMMY_FUNCTION_PASS("cfguard-check", CFGuardCheckPass, ())
DUMMY_FUNCTION_PASS("cfguard-dispatch", CFGuardDispatchPass, ())
DUMMY_FUNCTION_PASS("codegenprepare", CodeGenPreparePass, ())
-DUMMY_FUNCTION_PASS("dwarfehprepare", DwarfEHPass, ())
+DUMMY_FUNCTION_PASS("dwarf-eh-prepare", DwarfEHPass, ())
DUMMY_FUNCTION_PASS("expandmemcmp", ExpandMemCmpPass, ())
DUMMY_FUNCTION_PASS("gc-info-printer", GCInfoPrinterPass, ())
DUMMY_FUNCTION_PASS("gc-lowering", GCLoweringPass, ())
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index 71067d3ee286e..28e341fb05705 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -1296,6 +1296,7 @@ static bool isLoopPassName(StringRef Name, CallbacksT &Callbacks,
static StringRef convertToNewPassName(StringRef OldName) {
static StringMap<StringRef> NameMap = {{"callbr-prepare", "callbr-prepare"},
+ {"dwarfehprepare", "dwarf-eh-prepare"},
{"loweratomic", "lower-atomic"},
{"lowerinvoke", "lower-invoke"},
{"lowerswitch", "lower-switch"}};
diff --git a/llvm/lib/Passes/PassRegistry.def b/llvm/lib/Passes/PassRegistry.def
index 7c07a7332a590..2f1890759c3cc 100644
--- a/llvm/lib/Passes/PassRegistry.def
+++ b/llvm/lib/Passes/PassRegistry.def
@@ -302,7 +302,7 @@ FUNCTION_PASS("dot-dom-only", DomOnlyPrinter())
FUNCTION_PASS("dot-post-dom", PostDomPrinter())
FUNCTION_PASS("dot-post-dom-only", PostDomOnlyPrinter())
FUNCTION_PASS("dse", DSEPass())
-FUNCTION_PASS("dwarfehprepare", DwarfEHPreparePass(TM))
+FUNCTION_PASS("dwarf-eh-prepare", DwarfEHPreparePass(TM))
FUNCTION_PASS("expand-large-div-rem", ExpandLargeDivRemPass(TM))
FUNCTION_PASS("expand-large-fp-convert", ExpandLargeFpConvertPass(TM))
FUNCTION_PASS("fix-irreducible", FixIrreduciblePass())
diff --git a/llvm/test/CodeGen/X86/dwarf-eh-prepare-dbg.ll b/llvm/test/CodeGen/X86/dwarf-eh-prepare-dbg.ll
index 651e196a4ed76..1886a594b8092 100644
--- a/llvm/test/CodeGen/X86/dwarf-eh-prepare-dbg.ll
+++ b/llvm/test/CodeGen/X86/dwarf-eh-prepare-dbg.ll
@@ -1,6 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -mtriple=x86_64-linux-gnu -dwarfehprepare < %s | FileCheck %s
-; RUN: opt -S -mtriple=x86_64-linux-gnu -passes=dwarfehprepare < %s | FileCheck %s
+; RUN: opt -S -mtriple=x86_64-linux-gnu -passes=dwarf-eh-prepare < %s | FileCheck %s
; PR57469: If _Unwind_Resume is defined in the same module and we have debug
; info, then the inserted _Unwind_Resume calls also need to have a dummy debug
diff --git a/llvm/test/CodeGen/X86/dwarf-eh-prepare.ll b/llvm/test/CodeGen/X86/dwarf-eh-prepare.ll
index 6778601cfbf6d..a2e797a9dee4c 100644
--- a/llvm/test/CodeGen/X86/dwarf-eh-prepare.ll
+++ b/llvm/test/CodeGen/X86/dwarf-eh-prepare.ll
@@ -1,5 +1,5 @@
; RUN: opt -mtriple=x86_64-linux-gnu -dwarfehprepare -simplifycfg-require-and-preserve-domtree=1 -run-twice < %s -S | FileCheck %s
-; RUN: opt -mtriple=x86_64-linux-gnu -passes=dwarfehprepare -codegen-opt-level=2 -simplifycfg-require-and-preserve-domtree=1 -run-twice < %s -S | FileCheck %s
+; RUN: opt -mtriple=x86_64-linux-gnu -passes=dwarf-eh-prepare -codegen-opt-level=2 -simplifycfg-require-and-preserve-domtree=1 -run-twice < %s -S | FileCheck %s
; Check basic functionality of IR-to-IR DWARF EH preparation. This should
; eliminate resumes. This pass requires a TargetMachine, so we put it under X86
diff --git a/llvm/test/CodeGen/X86/dwarf_eh_resume.ll b/llvm/test/CodeGen/X86/dwarf_eh_resume.ll
index 90fad00b68bd8..359b813bd12e5 100644
--- a/llvm/test/CodeGen/X86/dwarf_eh_resume.ll
+++ b/llvm/test/CodeGen/X86/dwarf_eh_resume.ll
@@ -1,5 +1,5 @@
; RUN: opt -mtriple=x86_64-linux-gnu -dwarfehprepare -S %s | FileCheck %s
-; RUN: opt -mtriple=x86_64-linux-gnu -passes=dwarfehprepare -S %s | FileCheck %s
+; RUN: opt -mtriple=x86_64-linux-gnu -passes=dwarf-eh-prepare -S %s | FileCheck %s
declare i32 @hoge(...)
>From 0ff00faf2c776ff924b6996cff9492be58b37347 Mon Sep 17 00:00:00 2001
From: PaperChalice <29250197+paperchalice at users.noreply.github.com>
Date: Wed, 6 Dec 2023 14:18:25 +0800
Subject: [PATCH 07/10] [Pass] Rename `flattencfg` -> `flatten-cfg`
---
llvm/lib/Passes/PassBuilder.cpp | 1 +
llvm/lib/Passes/PassRegistry.def | 2 +-
llvm/lib/Transforms/Scalar/FlattenCFGPass.cpp | 2 +-
llvm/lib/Transforms/Utils/FlattenCFG.cpp | 2 +-
llvm/test/Transforms/Util/{flattencfg.ll => flatten-cfg.ll} | 2 +-
5 files changed, 5 insertions(+), 4 deletions(-)
rename llvm/test/Transforms/Util/{flattencfg.ll => flatten-cfg.ll} (99%)
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index 28e341fb05705..0bb3ea48af729 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -1297,6 +1297,7 @@ static bool isLoopPassName(StringRef Name, CallbacksT &Callbacks,
static StringRef convertToNewPassName(StringRef OldName) {
static StringMap<StringRef> NameMap = {{"callbr-prepare", "callbr-prepare"},
{"dwarfehprepare", "dwarf-eh-prepare"},
+ {"flattencfg", "flatten-cfg"},
{"loweratomic", "lower-atomic"},
{"lowerinvoke", "lower-invoke"},
{"lowerswitch", "lower-switch"}};
diff --git a/llvm/lib/Passes/PassRegistry.def b/llvm/lib/Passes/PassRegistry.def
index 2f1890759c3cc..a4d3359500446 100644
--- a/llvm/lib/Passes/PassRegistry.def
+++ b/llvm/lib/Passes/PassRegistry.def
@@ -306,7 +306,7 @@ FUNCTION_PASS("dwarf-eh-prepare", DwarfEHPreparePass(TM))
FUNCTION_PASS("expand-large-div-rem", ExpandLargeDivRemPass(TM))
FUNCTION_PASS("expand-large-fp-convert", ExpandLargeFpConvertPass(TM))
FUNCTION_PASS("fix-irreducible", FixIrreduciblePass())
-FUNCTION_PASS("flattencfg", FlattenCFGPass())
+FUNCTION_PASS("flatten-cfg", FlattenCFGPass())
FUNCTION_PASS("float2int", Float2IntPass())
FUNCTION_PASS("guard-widening", GuardWideningPass())
FUNCTION_PASS("gvn-hoist", GVNHoistPass())
diff --git a/llvm/lib/Transforms/Scalar/FlattenCFGPass.cpp b/llvm/lib/Transforms/Scalar/FlattenCFGPass.cpp
index ad2041cd4253f..213d0f389c2e4 100644
--- a/llvm/lib/Transforms/Scalar/FlattenCFGPass.cpp
+++ b/llvm/lib/Transforms/Scalar/FlattenCFGPass.cpp
@@ -21,7 +21,7 @@
using namespace llvm;
-#define DEBUG_TYPE "flattencfg"
+#define DEBUG_TYPE "flatten-cfg"
namespace {
struct FlattenCFGLegacyPass : public FunctionPass {
diff --git a/llvm/lib/Transforms/Utils/FlattenCFG.cpp b/llvm/lib/Transforms/Utils/FlattenCFG.cpp
index 1925b91c4da7e..db6ee39baece7 100644
--- a/llvm/lib/Transforms/Utils/FlattenCFG.cpp
+++ b/llvm/lib/Transforms/Utils/FlattenCFG.cpp
@@ -28,7 +28,7 @@
using namespace llvm;
-#define DEBUG_TYPE "flattencfg"
+#define DEBUG_TYPE "flatten-cfg"
namespace {
diff --git a/llvm/test/Transforms/Util/flattencfg.ll b/llvm/test/Transforms/Util/flatten-cfg.ll
similarity index 99%
rename from llvm/test/Transforms/Util/flattencfg.ll
rename to llvm/test/Transforms/Util/flatten-cfg.ll
index 4a4d4279f360d..d6e34bda1cc60 100644
--- a/llvm/test/Transforms/Util/flattencfg.ll
+++ b/llvm/test/Transforms/Util/flatten-cfg.ll
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
-; RUN: opt -passes=flattencfg -S < %s | FileCheck %s
+; RUN: opt -passes=flatten-cfg -S < %s | FileCheck %s
; This test checks whether the pass completes without a crash.
>From f2b3777b775b3dff9fe9c7628d5b5bf9a0f3d9b9 Mon Sep 17 00:00:00 2001
From: PaperChalice <29250197+paperchalice at users.noreply.github.com>
Date: Wed, 6 Dec 2023 14:26:44 +0800
Subject: [PATCH 08/10] [Pass] Rename `targetir` -> `target-ir`
---
llvm/include/llvm/CodeGen/MachinePassRegistry.def | 2 +-
llvm/lib/Passes/PassBuilder.cpp | 3 ++-
llvm/lib/Passes/PassRegistry.def | 2 +-
llvm/test/Other/new-pass-manager.ll | 2 +-
llvm/test/Transforms/IndVarSimplify/X86/iv-widen.ll | 2 +-
llvm/test/Transforms/IndVarSimplify/backedge-on-min-max.ll | 2 +-
llvm/test/Transforms/IndVarSimplify/sharpen-range.ll | 2 +-
llvm/test/Transforms/LICM/argmemonly-call.ll | 2 +-
llvm/test/Transforms/LICM/assume.ll | 2 +-
llvm/test/Transforms/LICM/basictest.ll | 2 +-
llvm/test/Transforms/LICM/call-hoisting.ll | 2 +-
llvm/test/Transforms/LICM/crash.ll | 2 +-
llvm/test/Transforms/LICM/dbg-value-sink.ll | 4 ++--
llvm/test/Transforms/LICM/debug-value.ll | 2 +-
llvm/test/Transforms/LICM/extra-copies.ll | 2 +-
llvm/test/Transforms/LICM/fence.ll | 2 +-
llvm/test/Transforms/LICM/funclet.ll | 2 +-
llvm/test/Transforms/LICM/guards.ll | 2 +-
llvm/test/Transforms/LICM/hoist-round.ll | 2 +-
llvm/test/Transforms/LICM/invariant.start.ll | 2 +-
llvm/test/Transforms/LICM/lcssa-ssa-promoter.ll | 2 +-
llvm/test/Transforms/LICM/no-preheader-test.ll | 2 +-
llvm/test/Transforms/LICM/opt-remarks-conditional-load.ll | 2 +-
llvm/test/Transforms/LICM/opt-remarks-intervening-store.ll | 2 +-
llvm/test/Transforms/LICM/opt-remarks.ll | 2 +-
llvm/test/Transforms/LICM/preheader-safe.ll | 2 +-
llvm/test/Transforms/LICM/promote-order.ll | 2 +-
llvm/test/Transforms/LICM/read-only-calls.ll | 2 +-
llvm/test/Transforms/LICM/scalar-promote-memmodel.ll | 2 +-
llvm/test/Transforms/LICM/scalar-promote-unwind.ll | 2 +-
llvm/test/Transforms/LICM/scalar-promote.ll | 2 +-
llvm/test/Transforms/LICM/speculate.ll | 2 +-
llvm/test/Transforms/LICM/store-hoisting.ll | 2 +-
llvm/test/Transforms/LICM/volatile-alias.ll | 2 +-
llvm/test/Transforms/LoopIdiom/nontemporal_store.ll | 2 +-
llvm/test/Transforms/LoopRotate/RISCV/invalid-cost.ll | 2 +-
llvm/test/Transforms/LoopRotate/basic.ll | 4 ++--
llvm/test/Transforms/LoopRotate/call-prepare-for-lto.ll | 4 ++--
llvm/test/Transforms/LoopRotate/noalias.ll | 4 ++--
llvm/test/Transforms/LoopStrengthReduce/ivchain.ll | 2 +-
40 files changed, 45 insertions(+), 44 deletions(-)
diff --git a/llvm/include/llvm/CodeGen/MachinePassRegistry.def b/llvm/include/llvm/CodeGen/MachinePassRegistry.def
index 5cefbb099aae4..a870f1e44fe84 100644
--- a/llvm/include/llvm/CodeGen/MachinePassRegistry.def
+++ b/llvm/include/llvm/CodeGen/MachinePassRegistry.def
@@ -29,7 +29,7 @@ MODULE_PASS("pre-isel-intrinsic-lowering", PreISelIntrinsicLoweringPass, ())
#define FUNCTION_ANALYSIS(NAME, PASS_NAME, CONSTRUCTOR)
#endif
FUNCTION_ANALYSIS("pass-instrumentation", PassInstrumentationAnalysis, (PIC))
-FUNCTION_ANALYSIS("targetir", TargetIRAnalysis,
+FUNCTION_ANALYSIS("target-ir", TargetIRAnalysis,
(std::move(TM.getTargetIRAnalysis())))
#undef FUNCTION_ANALYSIS
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index 0bb3ea48af729..de811909fd8c7 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -1300,7 +1300,8 @@ static StringRef convertToNewPassName(StringRef OldName) {
{"flattencfg", "flatten-cfg"},
{"loweratomic", "lower-atomic"},
{"lowerinvoke", "lower-invoke"},
- {"lowerswitch", "lower-switch"}};
+ {"lowerswitch", "lower-switch"},
+ {"targetir", "target-ir"}};
if (auto I = NameMap.find(OldName); I != NameMap.end()) {
auto NewName = I->second;
diff --git a/llvm/lib/Passes/PassRegistry.def b/llvm/lib/Passes/PassRegistry.def
index a4d3359500446..a09308a3fd54d 100644
--- a/llvm/lib/Passes/PassRegistry.def
+++ b/llvm/lib/Passes/PassRegistry.def
@@ -251,7 +251,7 @@ FUNCTION_ANALYSIS("should-not-run-function-passes",
FUNCTION_ANALYSIS("should-run-extra-vector-passes",
ShouldRunExtraVectorPasses())
FUNCTION_ANALYSIS("stack-safety-local", StackSafetyAnalysis())
-FUNCTION_ANALYSIS("targetir",
+FUNCTION_ANALYSIS("target-ir",
TM ? TM->getTargetIRAnalysis() : TargetIRAnalysis())
FUNCTION_ANALYSIS("targetlibinfo", TargetLibraryAnalysis())
FUNCTION_ANALYSIS("uniformity", UniformityInfoAnalysis())
diff --git a/llvm/test/Other/new-pass-manager.ll b/llvm/test/Other/new-pass-manager.ll
index 627b8b9a397eb..863f2e76e8304 100644
--- a/llvm/test/Other/new-pass-manager.ll
+++ b/llvm/test/Other/new-pass-manager.ll
@@ -211,7 +211,7 @@
; CHECK-TLI-NOT: Running analysis: TargetLibraryAnalysis
; RUN: opt -disable-output -disable-verify -verify-analysis-invalidation=0 -debug-pass-manager %s 2>&1 \
-; RUN: -passes='require<targetir>,invalidate<all>,require<targetir>' \
+; RUN: -passes='require<target-ir>,invalidate<all>,require<target-ir>' \
; RUN: | FileCheck %s --check-prefix=CHECK-TIRA
; CHECK-TIRA: Running pass: RequireAnalysisPass
; CHECK-TIRA: Running analysis: TargetIRAnalysis
diff --git a/llvm/test/Transforms/IndVarSimplify/X86/iv-widen.ll b/llvm/test/Transforms/IndVarSimplify/X86/iv-widen.ll
index 9eebb712b8937..d05755bea0ddd 100644
--- a/llvm/test/Transforms/IndVarSimplify/X86/iv-widen.ll
+++ b/llvm/test/Transforms/IndVarSimplify/X86/iv-widen.ll
@@ -1,6 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -passes=indvars -S | FileCheck %s
-; RUN: opt < %s -S -passes='lcssa,loop-simplify,require<targetir>,require<scalar-evolution>,require<domtree>,loop(indvars)' | FileCheck %s
+; RUN: opt < %s -S -passes='lcssa,loop-simplify,require<target-ir>,require<scalar-evolution>,require<domtree>,loop(indvars)' | FileCheck %s
; Provide legal integer types.
target datalayout = "n8:16:32:64"
diff --git a/llvm/test/Transforms/IndVarSimplify/backedge-on-min-max.ll b/llvm/test/Transforms/IndVarSimplify/backedge-on-min-max.ll
index 77b7cdaa0a506..c4b9a4e711b64 100644
--- a/llvm/test/Transforms/IndVarSimplify/backedge-on-min-max.ll
+++ b/llvm/test/Transforms/IndVarSimplify/backedge-on-min-max.ll
@@ -1,6 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
; RUN: opt < %s -passes=indvars -S | FileCheck %s
-; RUN: opt -passes=lcssa,loop-simplify -S < %s | opt -S -passes='require<targetir>,require<scalar-evolution>,require<domtree>,loop(indvars)'
+; RUN: opt -passes=lcssa,loop-simplify -S < %s | opt -S -passes='require<target-ir>,require<scalar-evolution>,require<domtree>,loop(indvars)'
;; --- signed ---
diff --git a/llvm/test/Transforms/IndVarSimplify/sharpen-range.ll b/llvm/test/Transforms/IndVarSimplify/sharpen-range.ll
index f07e8b07251de..4dd4e9831c966 100644
--- a/llvm/test/Transforms/IndVarSimplify/sharpen-range.ll
+++ b/llvm/test/Transforms/IndVarSimplify/sharpen-range.ll
@@ -1,5 +1,5 @@
;; RUN: opt -S < %s -passes=indvars | FileCheck %s
-; RUN: opt -passes=lcssa,loop-simplify -S < %s | opt -S -passes='require<targetir>,require<scalar-evolution>,require<domtree>,loop(indvars)'
+; RUN: opt -passes=lcssa,loop-simplify -S < %s | opt -S -passes='require<target-ir>,require<scalar-evolution>,require<domtree>,loop(indvars)'
;; Check if llvm can narrow !range metadata based on loop entry
;; predicates.
diff --git a/llvm/test/Transforms/LICM/argmemonly-call.ll b/llvm/test/Transforms/LICM/argmemonly-call.ll
index 89f762790bd8b..f990c955f56e3 100644
--- a/llvm/test/Transforms/LICM/argmemonly-call.ll
+++ b/llvm/test/Transforms/LICM/argmemonly-call.ll
@@ -1,4 +1,4 @@
-; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' < %s -S | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<target-ir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' < %s -S | FileCheck %s
declare i32 @foo() readonly argmemonly nounwind
declare i32 @foo2() readonly nounwind
diff --git a/llvm/test/Transforms/LICM/assume.ll b/llvm/test/Transforms/LICM/assume.ll
index f1afa2007f8e2..bfb0359dbdff0 100644
--- a/llvm/test/Transforms/LICM/assume.ll
+++ b/llvm/test/Transforms/LICM/assume.ll
@@ -1,5 +1,5 @@
; RUN: opt -passes=licm < %s -S | FileCheck %s
-; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' < %s -S | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<target-ir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' < %s -S | FileCheck %s
define void @f_0(i1 %p) nounwind ssp {
; CHECK-LABEL: @f_0(
diff --git a/llvm/test/Transforms/LICM/basictest.ll b/llvm/test/Transforms/LICM/basictest.ll
index 4152b07df5be5..4a54ce3f9610a 100644
--- a/llvm/test/Transforms/LICM/basictest.ll
+++ b/llvm/test/Transforms/LICM/basictest.ll
@@ -1,5 +1,5 @@
; RUN: opt < %s -passes=licm | llvm-dis
-; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' < %s | llvm-dis
+; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<target-ir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' < %s | llvm-dis
define void @testfunc(i32 %i) {
; <label>:0
diff --git a/llvm/test/Transforms/LICM/call-hoisting.ll b/llvm/test/Transforms/LICM/call-hoisting.ll
index cffe680cbe7df..e6d2e42e34e81 100644
--- a/llvm/test/Transforms/LICM/call-hoisting.ll
+++ b/llvm/test/Transforms/LICM/call-hoisting.ll
@@ -1,5 +1,5 @@
; RUN: opt -S -passes=licm %s | FileCheck %s
-; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' < %s -S | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<target-ir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' < %s -S | FileCheck %s
declare i32 @load(ptr %p) argmemonly readonly nounwind
diff --git a/llvm/test/Transforms/LICM/crash.ll b/llvm/test/Transforms/LICM/crash.ll
index aa9e11e851bac..2cb44daf8e24f 100644
--- a/llvm/test/Transforms/LICM/crash.ll
+++ b/llvm/test/Transforms/LICM/crash.ll
@@ -1,5 +1,5 @@
; RUN: opt -passes=licm -disable-output < %s
-; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' -disable-output < %s
+; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<target-ir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' -disable-output < %s
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
target triple = "x86_64-apple-darwin10.0.0"
diff --git a/llvm/test/Transforms/LICM/dbg-value-sink.ll b/llvm/test/Transforms/LICM/dbg-value-sink.ll
index 3970ca15192cc..e0bd4d57a67fe 100644
--- a/llvm/test/Transforms/LICM/dbg-value-sink.ll
+++ b/llvm/test/Transforms/LICM/dbg-value-sink.ll
@@ -1,8 +1,8 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-attributes
; RUN: opt < %s -passes='loop-mssa(licm)' -S | FileCheck %s
; RUN: opt < %s -passes='loop-mssa(licm)' -S --try-experimental-debuginfo-iterators | FileCheck %s
-; RUN: opt -aa-pipeline=tbaa,basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' -S %s | FileCheck %s
-; RUN: opt -aa-pipeline=tbaa,basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' -S %s --try-experimental-debuginfo-iterators| FileCheck %s
+; RUN: opt -aa-pipeline=tbaa,basic-aa -passes='require<aa>,require<target-ir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' -S %s | FileCheck %s
+; RUN: opt -aa-pipeline=tbaa,basic-aa -passes='require<aa>,require<target-ir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' -S %s --try-experimental-debuginfo-iterators| FileCheck %s
;
; Test that when we sink the store into the "Out" block, it lands in front of
; the dbg.value that we've left there.
diff --git a/llvm/test/Transforms/LICM/debug-value.ll b/llvm/test/Transforms/LICM/debug-value.ll
index e1121d2129799..b15fafcf97556 100644
--- a/llvm/test/Transforms/LICM/debug-value.ll
+++ b/llvm/test/Transforms/LICM/debug-value.ll
@@ -1,5 +1,5 @@
; RUN: opt -passes=licm < %s -S | FileCheck %s
-; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' < %s -S | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<target-ir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' < %s -S | FileCheck %s
; RUN: opt -passes=licm < %s -S --try-experimental-debuginfo-iterators | FileCheck %s
diff --git a/llvm/test/Transforms/LICM/extra-copies.ll b/llvm/test/Transforms/LICM/extra-copies.ll
index defd2690a775a..33ad89f4b21e9 100644
--- a/llvm/test/Transforms/LICM/extra-copies.ll
+++ b/llvm/test/Transforms/LICM/extra-copies.ll
@@ -1,5 +1,5 @@
; RUN: opt < %s -passes=licm -S | FileCheck %s
-; RUN: opt -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' < %s -S | FileCheck %s
+; RUN: opt -passes='require<aa>,require<target-ir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' < %s -S | FileCheck %s
; PR19835
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
diff --git a/llvm/test/Transforms/LICM/fence.ll b/llvm/test/Transforms/LICM/fence.ll
index 299411aec95b7..0dd4d010f7aa4 100644
--- a/llvm/test/Transforms/LICM/fence.ll
+++ b/llvm/test/Transforms/LICM/fence.ll
@@ -1,5 +1,5 @@
; RUN: opt -passes=licm < %s -S | FileCheck %s
-; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' < %s -S | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<target-ir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' < %s -S | FileCheck %s
define void @test1(i64 %n) {
; CHECK-LABEL: @test1
diff --git a/llvm/test/Transforms/LICM/funclet.ll b/llvm/test/Transforms/LICM/funclet.ll
index 140bc57093f1b..cacb0c90d3702 100644
--- a/llvm/test/Transforms/LICM/funclet.ll
+++ b/llvm/test/Transforms/LICM/funclet.ll
@@ -1,6 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -passes=licm -S | FileCheck %s
-; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' < %s -S | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<target-ir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' < %s -S | FileCheck %s
target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
target triple = "i386-pc-windows-msvc18.0.0"
diff --git a/llvm/test/Transforms/LICM/guards.ll b/llvm/test/Transforms/LICM/guards.ll
index fcfe299d656e6..361d938ce19b8 100644
--- a/llvm/test/Transforms/LICM/guards.ll
+++ b/llvm/test/Transforms/LICM/guards.ll
@@ -1,7 +1,7 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; REQUIRES: asserts
; RUN: opt -passes=licm -ipt-expensive-asserts=true < %s -S | FileCheck %s
-; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' -ipt-expensive-asserts=true < %s -S | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<target-ir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' -ipt-expensive-asserts=true < %s -S | FileCheck %s
; Hoist guard and load.
define void @test1(i1 %cond, ptr %ptr) {
diff --git a/llvm/test/Transforms/LICM/hoist-round.ll b/llvm/test/Transforms/LICM/hoist-round.ll
index 971e9e90a55f3..cc67e7360a88f 100644
--- a/llvm/test/Transforms/LICM/hoist-round.ll
+++ b/llvm/test/Transforms/LICM/hoist-round.ll
@@ -1,4 +1,4 @@
-; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' -S %s | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<target-ir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' -S %s | FileCheck %s
; RUN: opt -S -passes=licm -verify-memoryssa < %s | FileCheck %s
target datalayout = "E-m:e-p:32:32-i8:8:8-i16:16:16-i64:32:32-f64:32:32-v64:32:32-v128:32:32-a0:0:32-n32"
diff --git a/llvm/test/Transforms/LICM/invariant.start.ll b/llvm/test/Transforms/LICM/invariant.start.ll
index 1ba646b8858ad..c9c16423e2637 100644
--- a/llvm/test/Transforms/LICM/invariant.start.ll
+++ b/llvm/test/Transforms/LICM/invariant.start.ll
@@ -1,6 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -passes=licm < %s -S | FileCheck %s
-; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' < %s -S | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<target-ir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' < %s -S | FileCheck %s
define void @test1(i1 %cond, ptr %ptr) {
; CHECK-LABEL: @test1(
diff --git a/llvm/test/Transforms/LICM/lcssa-ssa-promoter.ll b/llvm/test/Transforms/LICM/lcssa-ssa-promoter.ll
index 5bc677a609bef..a68fb0d00af1b 100644
--- a/llvm/test/Transforms/LICM/lcssa-ssa-promoter.ll
+++ b/llvm/test/Transforms/LICM/lcssa-ssa-promoter.ll
@@ -1,6 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -passes=licm < %s | FileCheck %s
-; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' -S %s| FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<target-ir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' -S %s| FileCheck %s
;
; Manually validate LCSSA form is preserved even after SSAUpdater is used to
; promote things in the loop bodies.
diff --git a/llvm/test/Transforms/LICM/no-preheader-test.ll b/llvm/test/Transforms/LICM/no-preheader-test.ll
index 091dbd31d3682..53dcfc75cd803 100644
--- a/llvm/test/Transforms/LICM/no-preheader-test.ll
+++ b/llvm/test/Transforms/LICM/no-preheader-test.ll
@@ -1,6 +1,6 @@
; Test that LICM works when there is not a loop-preheader
; RUN: opt < %s -passes=licm | llvm-dis
-; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' < %s | llvm-dis
+; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<target-ir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' < %s | llvm-dis
define void @testfunc(i32 %i.s, i1 %ifcond) {
br i1 %ifcond, label %Then, label %Else
diff --git a/llvm/test/Transforms/LICM/opt-remarks-conditional-load.ll b/llvm/test/Transforms/LICM/opt-remarks-conditional-load.ll
index 9d48f91337f50..686ec6bbf11bc 100644
--- a/llvm/test/Transforms/LICM/opt-remarks-conditional-load.ll
+++ b/llvm/test/Transforms/LICM/opt-remarks-conditional-load.ll
@@ -1,5 +1,5 @@
; RUN: opt < %s -passes=licm -pass-remarks-missed=licm -o /dev/null 2>&1 | FileCheck %s
-; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' %s -o /dev/null -pass-remarks-missed=licm 2>&1 | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<target-ir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' %s -o /dev/null -pass-remarks-missed=licm 2>&1 | FileCheck %s
target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"
; With the load from %p conditional, we can't optmize this and the remark
diff --git a/llvm/test/Transforms/LICM/opt-remarks-intervening-store.ll b/llvm/test/Transforms/LICM/opt-remarks-intervening-store.ll
index 3092c82467538..7487f65e29671 100644
--- a/llvm/test/Transforms/LICM/opt-remarks-intervening-store.ll
+++ b/llvm/test/Transforms/LICM/opt-remarks-intervening-store.ll
@@ -1,5 +1,5 @@
; RUN: opt < %s -passes=licm -pass-remarks-missed=licm -o /dev/null 2>&1 | FileCheck %s
-; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' %s -o /dev/null -pass-remarks-missed=licm 2>&1 | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<target-ir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' %s -o /dev/null -pass-remarks-missed=licm 2>&1 | FileCheck %s
target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"
; Without the noalias on %p, we can't optmize this and the remark should tell
diff --git a/llvm/test/Transforms/LICM/opt-remarks.ll b/llvm/test/Transforms/LICM/opt-remarks.ll
index 153e685d4685e..b70db6f4e33e2 100644
--- a/llvm/test/Transforms/LICM/opt-remarks.ll
+++ b/llvm/test/Transforms/LICM/opt-remarks.ll
@@ -1,5 +1,5 @@
; RUN: opt < %s -passes=licm -pass-remarks=licm -o /dev/null 2>&1 | FileCheck %s
-; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' %s -o /dev/null -pass-remarks=licm 2>&1 | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<target-ir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' %s -o /dev/null -pass-remarks=licm 2>&1 | FileCheck %s
target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"
define void @hoist(ptr %array, ptr noalias %p) {
diff --git a/llvm/test/Transforms/LICM/preheader-safe.ll b/llvm/test/Transforms/LICM/preheader-safe.ll
index 0fd05e5aacc9d..a96e847c51d9f 100644
--- a/llvm/test/Transforms/LICM/preheader-safe.ll
+++ b/llvm/test/Transforms/LICM/preheader-safe.ll
@@ -1,5 +1,5 @@
; RUN: opt -S -passes=licm < %s | FileCheck %s
-; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' -S %s | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<target-ir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' -S %s | FileCheck %s
declare void @use_nothrow(i64 %a) nounwind
declare void @use(i64 %a)
diff --git a/llvm/test/Transforms/LICM/promote-order.ll b/llvm/test/Transforms/LICM/promote-order.ll
index 6cb129e0a72a1..e42b42564dec6 100644
--- a/llvm/test/Transforms/LICM/promote-order.ll
+++ b/llvm/test/Transforms/LICM/promote-order.ll
@@ -1,4 +1,4 @@
-; RUN: opt -aa-pipeline=tbaa,basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' -S %s | FileCheck %s
+; RUN: opt -aa-pipeline=tbaa,basic-aa -passes='require<aa>,require<target-ir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' -S %s | FileCheck %s
; LICM should keep the stores in their original order when it sinks/promotes them.
; rdar://12045203
diff --git a/llvm/test/Transforms/LICM/read-only-calls.ll b/llvm/test/Transforms/LICM/read-only-calls.ll
index 6214e45160425..87899045f1655 100644
--- a/llvm/test/Transforms/LICM/read-only-calls.ll
+++ b/llvm/test/Transforms/LICM/read-only-calls.ll
@@ -1,4 +1,4 @@
-; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' < %s -S | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<target-ir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' < %s -S | FileCheck %s
; We should be able to hoist loads in presence of read only calls and stores
; that do not alias.
diff --git a/llvm/test/Transforms/LICM/scalar-promote-memmodel.ll b/llvm/test/Transforms/LICM/scalar-promote-memmodel.ll
index 762cf8fd63bf7..78a1c2b4adb1f 100644
--- a/llvm/test/Transforms/LICM/scalar-promote-memmodel.ll
+++ b/llvm/test/Transforms/LICM/scalar-promote-memmodel.ll
@@ -1,6 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -passes=licm -S | FileCheck %s
-; RUN: opt -aa-pipeline=tbaa,basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' -S %s | FileCheck %s
+; RUN: opt -aa-pipeline=tbaa,basic-aa -passes='require<aa>,require<target-ir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' -S %s | FileCheck %s
; Make sure we don't hoist a conditionally-executed store out of the loop;
; it would violate the concurrency memory model
diff --git a/llvm/test/Transforms/LICM/scalar-promote-unwind.ll b/llvm/test/Transforms/LICM/scalar-promote-unwind.ll
index ac79aec5ffc2f..82ffd42d77e62 100644
--- a/llvm/test/Transforms/LICM/scalar-promote-unwind.ll
+++ b/llvm/test/Transforms/LICM/scalar-promote-unwind.ll
@@ -1,6 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -passes=licm -S | FileCheck %s
-; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' -S %s | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<target-ir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' -S %s | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
diff --git a/llvm/test/Transforms/LICM/scalar-promote.ll b/llvm/test/Transforms/LICM/scalar-promote.ll
index 0ce85081a69b4..bd3960e846b42 100644
--- a/llvm/test/Transforms/LICM/scalar-promote.ll
+++ b/llvm/test/Transforms/LICM/scalar-promote.ll
@@ -1,6 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-attributes
; RUN: opt < %s -passes=licm -S | FileCheck %s
-; RUN: opt -aa-pipeline=tbaa,basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' -S %s | FileCheck %s
+; RUN: opt -aa-pipeline=tbaa,basic-aa -passes='require<aa>,require<target-ir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' -S %s | FileCheck %s
target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"
@X = global i32 7 ; <ptr> [#uses=4]
diff --git a/llvm/test/Transforms/LICM/speculate.ll b/llvm/test/Transforms/LICM/speculate.ll
index 7f753b520dd3d..03cb55580a41d 100644
--- a/llvm/test/Transforms/LICM/speculate.ll
+++ b/llvm/test/Transforms/LICM/speculate.ll
@@ -1,5 +1,5 @@
; RUN: opt -S -passes=licm < %s | FileCheck %s
-; RUN: opt -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' -S %s | FileCheck %s
+; RUN: opt -passes='require<aa>,require<target-ir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' -S %s | FileCheck %s
; UDiv is safe to speculate if the denominator is known non-zero.
diff --git a/llvm/test/Transforms/LICM/store-hoisting.ll b/llvm/test/Transforms/LICM/store-hoisting.ll
index 3b36f299eaef5..d4f62d1c16f06 100644
--- a/llvm/test/Transforms/LICM/store-hoisting.ll
+++ b/llvm/test/Transforms/LICM/store-hoisting.ll
@@ -1,4 +1,4 @@
-; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' < %s -S | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<target-ir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' < %s -S | FileCheck %s
define void @test(ptr %loc) {
; CHECK-LABEL: @test
diff --git a/llvm/test/Transforms/LICM/volatile-alias.ll b/llvm/test/Transforms/LICM/volatile-alias.ll
index 2c9123edeee12..410f3becc5bac 100644
--- a/llvm/test/Transforms/LICM/volatile-alias.ll
+++ b/llvm/test/Transforms/LICM/volatile-alias.ll
@@ -1,4 +1,4 @@
-; RUN: opt -passes='sroa,loop(loop-rotate)' %s | opt -aa-pipeline=basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' -S | FileCheck %s
+; RUN: opt -passes='sroa,loop(loop-rotate)' %s | opt -aa-pipeline=basic-aa -passes='require<aa>,require<target-ir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' -S | FileCheck %s
; RUN: opt -passes='sroa,loop(loop-rotate),loop-mssa(licm)' -verify-memoryssa -S < %s | FileCheck %s
; The objects *p and *q are aliased to each other, but even though *q is
; volatile, *p can be considered invariant in the loop. Check if it is moved
diff --git a/llvm/test/Transforms/LoopIdiom/nontemporal_store.ll b/llvm/test/Transforms/LoopIdiom/nontemporal_store.ll
index c143587535533..08d241911bfdd 100644
--- a/llvm/test/Transforms/LoopIdiom/nontemporal_store.ll
+++ b/llvm/test/Transforms/LoopIdiom/nontemporal_store.ll
@@ -1,5 +1,5 @@
; RUN: opt -passes=loop-idiom < %s -S | FileCheck %s
-; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop(loop-idiom)' < %s -S | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<target-ir>,require<scalar-evolution>,require<opt-remark-emit>,loop(loop-idiom)' < %s -S | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
diff --git a/llvm/test/Transforms/LoopRotate/RISCV/invalid-cost.ll b/llvm/test/Transforms/LoopRotate/RISCV/invalid-cost.ll
index 5f04bb15c1a26..46504596d74f5 100644
--- a/llvm/test/Transforms/LoopRotate/RISCV/invalid-cost.ll
+++ b/llvm/test/Transforms/LoopRotate/RISCV/invalid-cost.ll
@@ -1,6 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -passes=loop-rotate -verify-memoryssa < %s | FileCheck %s
-; RUN: opt -S -passes='require<targetir>,require<assumptions>,loop(loop-rotate)' < %s | FileCheck %s
+; RUN: opt -S -passes='require<target-ir>,require<assumptions>,loop(loop-rotate)' < %s | FileCheck %s
; Demonstrate handling of invalid costs in LoopRotate. This test uses
; scalable vectors on RISCV w/o +V to create a situation where a construct
diff --git a/llvm/test/Transforms/LoopRotate/basic.ll b/llvm/test/Transforms/LoopRotate/basic.ll
index aa9f510c82630..b3c35f1edd3ea 100644
--- a/llvm/test/Transforms/LoopRotate/basic.ll
+++ b/llvm/test/Transforms/LoopRotate/basic.ll
@@ -1,6 +1,6 @@
; RUN: opt -S -passes=loop-rotate -verify-memoryssa < %s | FileCheck %s
-; RUN: opt -S -passes='require<targetir>,require<assumptions>,loop(loop-rotate)' < %s | FileCheck %s
-; RUN: opt -S -passes='require<targetir>,require<assumptions>,loop-mssa(loop-rotate)' -verify-memoryssa < %s | FileCheck %s
+; RUN: opt -S -passes='require<target-ir>,require<assumptions>,loop(loop-rotate)' < %s | FileCheck %s
+; RUN: opt -S -passes='require<target-ir>,require<assumptions>,loop-mssa(loop-rotate)' -verify-memoryssa < %s | FileCheck %s
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
target triple = "x86_64-apple-darwin10.0.0"
diff --git a/llvm/test/Transforms/LoopRotate/call-prepare-for-lto.ll b/llvm/test/Transforms/LoopRotate/call-prepare-for-lto.ll
index e4be918aed609..a7c957a41f79f 100644
--- a/llvm/test/Transforms/LoopRotate/call-prepare-for-lto.ll
+++ b/llvm/test/Transforms/LoopRotate/call-prepare-for-lto.ll
@@ -1,7 +1,7 @@
; RUN: opt -S -passes=loop-rotate < %s | FileCheck --check-prefix=FULL %s
; RUN: opt -S -passes=loop-rotate -rotation-prepare-for-lto < %s | FileCheck --check-prefix=PREPARE %s
-; RUN: opt -S -passes='require<targetir>,require<assumptions>,loop(loop-rotate)' < %s | FileCheck --check-prefix=FULL %s
-; RUN: opt -S -passes='require<targetir>,require<assumptions>,loop(loop-rotate)' -rotation-prepare-for-lto < %s | FileCheck --check-prefix=PREPARE %s
+; RUN: opt -S -passes='require<target-ir>,require<assumptions>,loop(loop-rotate)' < %s | FileCheck --check-prefix=FULL %s
+; RUN: opt -S -passes='require<target-ir>,require<assumptions>,loop(loop-rotate)' -rotation-prepare-for-lto < %s | FileCheck --check-prefix=PREPARE %s
; Test case to make sure loop-rotate avoids rotating during the prepare-for-lto
; stage, when the header contains a call which may be inlined during the LTO stage.
diff --git a/llvm/test/Transforms/LoopRotate/noalias.ll b/llvm/test/Transforms/LoopRotate/noalias.ll
index da72a5f8b57a3..f709bba1cb4b1 100644
--- a/llvm/test/Transforms/LoopRotate/noalias.ll
+++ b/llvm/test/Transforms/LoopRotate/noalias.ll
@@ -1,6 +1,6 @@
; RUN: opt -S -passes=loop-rotate -verify-memoryssa < %s | FileCheck %s
-; RUN: opt -S -passes='require<targetir>,require<assumptions>,loop(loop-rotate)' < %s | FileCheck %s
-; RUN: opt -S -passes='require<targetir>,require<assumptions>,loop(loop-rotate)' -verify-memoryssa < %s | FileCheck %s
+; RUN: opt -S -passes='require<target-ir>,require<assumptions>,loop(loop-rotate)' < %s | FileCheck %s
+; RUN: opt -S -passes='require<target-ir>,require<assumptions>,loop(loop-rotate)' -verify-memoryssa < %s | FileCheck %s
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
diff --git a/llvm/test/Transforms/LoopStrengthReduce/ivchain.ll b/llvm/test/Transforms/LoopStrengthReduce/ivchain.ll
index 49a06f0aee371..0c1dce52d0876 100644
--- a/llvm/test/Transforms/LoopStrengthReduce/ivchain.ll
+++ b/llvm/test/Transforms/LoopStrengthReduce/ivchain.ll
@@ -1,6 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
; RUN: opt < %s -loop-reduce -S | FileCheck %s
-; RUN: opt -passes='require<scalar-evolution>,require<targetir>,loop(loop-reduce)' < %s -S | FileCheck %s
+; RUN: opt -passes='require<scalar-evolution>,require<target-ir>,loop(loop-reduce)' < %s -S | FileCheck %s
;
; PR11782: bad cast to AddRecExpr.
; A sign extend feeds an IVUser and cannot be hoisted into the AddRec.
>From 585bf651c21c89b551fde91bea03d3259fb35356 Mon Sep 17 00:00:00 2001
From: PaperChalice <29250197+paperchalice at users.noreply.github.com>
Date: Wed, 6 Dec 2023 14:30:29 +0800
Subject: [PATCH 09/10] [Pass] Rename `targetlibinfo` -> `target-lib-info`
---
llvm/lib/Passes/PassRegistry.def | 2 +-
llvm/test/Other/new-pass-manager.ll | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/llvm/lib/Passes/PassRegistry.def b/llvm/lib/Passes/PassRegistry.def
index a09308a3fd54d..d8484e96d0940 100644
--- a/llvm/lib/Passes/PassRegistry.def
+++ b/llvm/lib/Passes/PassRegistry.def
@@ -253,7 +253,7 @@ FUNCTION_ANALYSIS("should-run-extra-vector-passes",
FUNCTION_ANALYSIS("stack-safety-local", StackSafetyAnalysis())
FUNCTION_ANALYSIS("target-ir",
TM ? TM->getTargetIRAnalysis() : TargetIRAnalysis())
-FUNCTION_ANALYSIS("targetlibinfo", TargetLibraryAnalysis())
+FUNCTION_ANALYSIS("target-lib-info", TargetLibraryAnalysis())
FUNCTION_ANALYSIS("uniformity", UniformityInfoAnalysis())
FUNCTION_ANALYSIS("verify", VerifierAnalysis())
diff --git a/llvm/test/Other/new-pass-manager.ll b/llvm/test/Other/new-pass-manager.ll
index 863f2e76e8304..904307659ad1f 100644
--- a/llvm/test/Other/new-pass-manager.ll
+++ b/llvm/test/Other/new-pass-manager.ll
@@ -201,7 +201,7 @@
; CHECK-INVALIDATE-ALL-CG-NOT: Running analysis: NoOpModuleAnalysis
; RUN: opt -disable-output -disable-verify -verify-analysis-invalidation=0 -debug-pass-manager %s 2>&1 \
-; RUN: -passes='require<targetlibinfo>,invalidate<all>,require<targetlibinfo>' \
+; RUN: -passes='require<target-lib-info>,invalidate<all>,require<target-lib-info>' \
; RUN: | FileCheck %s --check-prefix=CHECK-TLI
; CHECK-TLI: Running pass: RequireAnalysisPass
; CHECK-TLI: Running analysis: TargetLibraryAnalysis
>From c5ed44f61c69ffdbe7999055cda23bebdffe3476 Mon Sep 17 00:00:00 2001
From: PaperChalice <29250197+paperchalice at users.noreply.github.com>
Date: Wed, 6 Dec 2023 14:39:53 +0800
Subject: [PATCH 10/10] PassBuilder: Rename `winehprepare` -> `winehprepare`
---
llvm/lib/Passes/PassBuilder.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index de811909fd8c7..b51a0d3939771 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -1301,6 +1301,7 @@ static StringRef convertToNewPassName(StringRef OldName) {
{"loweratomic", "lower-atomic"},
{"lowerinvoke", "lower-invoke"},
{"lowerswitch", "lower-switch"},
+ {"winehprepare", "win-eh-prepare"},
{"targetir", "target-ir"}};
if (auto I = NameMap.find(OldName); I != NameMap.end()) {
More information about the llvm-commits
mailing list