Skip to content

Commit 811bc56

Browse files
committed
[Pass] Rename lowerswitch -> lower-switch
1 parent 508b20d commit 811bc56

24 files changed

+30
-29
lines changed

llvm/docs/Passes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -748,8 +748,8 @@ support stack unwinding. This pass converts ``invoke`` instructions to
748748
become dead code (which can be removed by running the ``-simplifycfg`` pass
749749
afterwards).
750750

751-
``lowerswitch``: Lower ``SwitchInst``\ s to branches
752-
----------------------------------------------------
751+
``lower-switch``: Lower ``SwitchInst``\ s to branches
752+
-----------------------------------------------------
753753

754754
Rewrites switch instructions with a sequence of branches, which allows targets
755755
to get away with not implementing the switch instruction until it is

llvm/lib/Passes/PassBuilder.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1296,7 +1296,8 @@ static bool isLoopPassName(StringRef Name, CallbacksT &Callbacks,
12961296

12971297
static StringRef convertToNewPassName(StringRef OldName) {
12981298
static StringMap<StringRef> NameMap = {{"loweratomic", "lower-atomic"},
1299-
{"lowerinvoke", "lower-invoke"}};
1299+
{"lowerinvoke", "lower-invoke"},
1300+
{"lowerswitch", "lower-switch"}};
13001301

13011302
if (auto I = NameMap.find(OldName); I != NameMap.end()) {
13021303
auto NewName = I->second;

llvm/lib/Passes/PassRegistry.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,8 @@ FUNCTION_PASS("lower-constant-intrinsics", LowerConstantIntrinsicsPass())
338338
FUNCTION_PASS("lower-expect", LowerExpectIntrinsicPass())
339339
FUNCTION_PASS("lower-guard-intrinsic", LowerGuardIntrinsicPass())
340340
FUNCTION_PASS("lower-invoke", LowerInvokePass())
341+
FUNCTION_PASS("lower-switch", LowerSwitchPass())
341342
FUNCTION_PASS("lower-widenable-condition", LowerWidenableConditionPass())
342-
FUNCTION_PASS("lowerswitch", LowerSwitchPass())
343343
FUNCTION_PASS("make-guards-explicit", MakeGuardsExplicitPass())
344344
FUNCTION_PASS("mem2reg", PromotePass())
345345
FUNCTION_PASS("memcpyopt", MemCpyOptPass())

llvm/test/Transforms/FixIrreducible/switch.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2-
; RUN: opt < %s -passes='lowerswitch,fix-irreducible' -S | FileCheck %s
2+
; RUN: opt < %s -passes='lower-switch,fix-irreducible' -S | FileCheck %s
33

44
define void @loop_1(i32 %Value, i1 %PredEntry, i1 %PredD) {
55
; CHECK-LABEL: @loop_1(

llvm/test/Transforms/LowerSwitch/2003-05-01-PHIProblem.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: opt < %s -passes=lowerswitch
1+
; RUN: opt < %s -passes=lower-switch
22

33
define void @child(i32 %ct.1) {
44
entry:

llvm/test/Transforms/LowerSwitch/2003-08-23-EmptySwitch.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: opt < %s -passes=lowerswitch
1+
; RUN: opt < %s -passes=lower-switch
22

33
define void @test() {
44
switch i32 0, label %Next [

llvm/test/Transforms/LowerSwitch/2004-03-13-SwitchIsDefaultCrash.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: opt < %s -passes=lowerswitch -disable-output
1+
; RUN: opt < %s -passes=lower-switch -disable-output
22

33
define void @solve() {
44
entry:

llvm/test/Transforms/LowerSwitch/2014-06-10-SwitchContiguousOpt.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: opt < %s -passes=lowerswitch -S | FileCheck %s
1+
; RUN: opt < %s -passes=lower-switch -S | FileCheck %s
22
; CHECK-NOT: icmp eq i32 %0, 1
33

44
define i32 @foo(i32 %a) #0 {

llvm/test/Transforms/LowerSwitch/2014-06-11-SwitchDefaultUnreachableOpt.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: opt < %s -passes=lowerswitch -S | FileCheck %s
1+
; RUN: opt < %s -passes=lower-switch -S | FileCheck %s
22
;
33
; The switch is lowered with a single icmp.
44
; CHECK: icmp

llvm/test/Transforms/LowerSwitch/2014-06-23-PHIlowering.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: opt < %s -passes=lowerswitch -S | FileCheck %s
1+
; RUN: opt < %s -passes=lower-switch -S | FileCheck %s
22

33
define i32 @test(i32 %arg) #0 {
44
; CHECK-LABEL: @test

llvm/test/Transforms/LowerSwitch/condition-phi-unreachable-default.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
; RUN: opt < %s -passes=lowerswitch -S | FileCheck %s
1+
; RUN: opt < %s -passes=lower-switch -S | FileCheck %s
22

3-
; This test verifies -lowerswitch does not crash when an removing an
3+
; This test verifies -lower-switch does not crash when an removing an
44
; unreachable default branch causes a PHI node used as the switch
55
; condition to be erased.
66

llvm/test/Transforms/LowerSwitch/delete-default-block-crash.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
; RUN: opt < %s -passes=lowerswitch -disable-output
1+
; RUN: opt < %s -passes=lower-switch -disable-output
22

3-
; This test verify -lowerswitch does not crash after deleting the default block.
3+
; This test verify -lower-switch does not crash after deleting the default block.
44

55
declare i32 @f(i32)
66

llvm/test/Transforms/LowerSwitch/do-not-handle-impossible-values.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2-
; RUN: opt < %s -passes=lowerswitch -S | FileCheck %s
2+
; RUN: opt < %s -passes=lower-switch -S | FileCheck %s
33

44
; Check that we do not generate redundant comparisons that would have results
55
; known at compile time due to limited range of the value being switch'ed over.

llvm/test/Transforms/LowerSwitch/feature.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: opt < %s -passes=lowerswitch -S | FileCheck %s
1+
; RUN: opt < %s -passes=lower-switch -S | FileCheck %s
22

33
; We have switch on input.
44
; On output we should got binary comparison tree. Check that all is fine.

llvm/test/Transforms/LowerSwitch/fold-popular-case-to-unreachable-default.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: opt %s -passes=lowerswitch -S | FileCheck %s
1+
; RUN: opt %s -passes=lower-switch -S | FileCheck %s
22

33
define void @foo(i32 %x, ptr %p) {
44
; Cases 2 and 4 are removed and become the new default case.

llvm/test/Transforms/LowerSwitch/phi-in-dead-block.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: opt -S -passes=lowerswitch %s | FileCheck %s
1+
; RUN: opt -S -passes=lower-switch %s | FileCheck %s
22

33
; CHECK-LABEL: @phi_in_dead_block(
44
; CHECK-NOT: switch

llvm/test/Transforms/LowerSwitch/pr59316.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2-
; RUN: opt < %s -passes=lowerswitch -S | FileCheck %s
2+
; RUN: opt < %s -passes=lower-switch -S | FileCheck %s
33

44
define i64 @f(i1 %bool, i128 %i128) {
55
; CHECK-LABEL: @f(

llvm/test/Transforms/StructurizeCFG/switch.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: opt -S -passes='lowerswitch,structurizecfg' %s -o - | FileCheck %s
1+
; RUN: opt -S -passes='lower-switch,structurizecfg' %s -o - | FileCheck %s
22

33
; The structurizecfg pass cannot handle switch instructions, so we need to
44
; make sure the lower switch pass is always run before structurizecfg.

llvm/test/Transforms/UnifyFunctionExitNodes/unreachable-blocks-status.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: opt -passes='break-crit-edges,lowerswitch,mergereturn' -S < %s | FileCheck %s
1+
; RUN: opt -passes='break-crit-edges,lower-switch,mergereturn' -S < %s | FileCheck %s
22

33
; The pass did previously not report the correct Modified status in the case
44
; where a function had at most one return block, and an unified unreachable

llvm/test/Transforms/UnifyLoopExits/basic.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2-
; RUN: opt < %s -passes='lowerswitch,unify-loop-exits' -S | FileCheck %s
2+
; RUN: opt < %s -passes='lower-switch,unify-loop-exits' -S | FileCheck %s
33

44
define void @loop_1(i1 %PredEntry, i1 %PredB, i1 %PredC, i1 %PredD) {
55
; CHECK-LABEL: @loop_1(

llvm/test/Transforms/UnifyLoopExits/nested.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2-
; RUN: opt < %s -passes='lowerswitch,unify-loop-exits' -S | FileCheck %s
2+
; RUN: opt < %s -passes='lower-switch,unify-loop-exits' -S | FileCheck %s
33

44
define void @nested(i1 %PredB3, i1 %PredB4, i1 %PredA4, i1 %PredA3, i32 %X, i32 %Y, i32 %Z) {
55
; CHECK-LABEL: @nested(

llvm/test/Transforms/UnifyLoopExits/restore-ssa.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2-
; RUN: opt < %s -passes='lowerswitch,unify-loop-exits' -S | FileCheck %s
2+
; RUN: opt < %s -passes='lower-switch,unify-loop-exits' -S | FileCheck %s
33

44
; Loop consists of A and B:
55
; - A is the header

llvm/test/Transforms/UnifyLoopExits/switch.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2-
; RUN: opt < %s -passes='lowerswitch,unify-loop-exits' -S | FileCheck %s
2+
; RUN: opt < %s -passes='lower-switch,unify-loop-exits' -S | FileCheck %s
33

44
define void @loop_1(i32 %Value, i1 %PredEntry, i1 %PredD) {
55
; CHECK-LABEL: @loop_1(

llvm/test/Transforms/Util/lowerswitch.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: opt -passes=lowerswitch -S < %s | FileCheck %s
1+
; RUN: opt -passes=lower-switch -S < %s | FileCheck %s
22

33
; Test that we don't crash and have a different basic block for each incoming edge.
44
define void @test0(i32 %mode) {
@@ -31,7 +31,7 @@ BB3:
3131
br label %BB2
3232
}
3333

34-
; Test switch cases that are merged into a single case during lowerswitch
34+
; Test switch cases that are merged into a single case during lower-switch
3535
; (take 84 and 85 below) - check that the number of incoming phi values match
3636
; the number of branches.
3737
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) {
198198
}
199199

200200
; Test that the PHI node in for.cond should have one entry for each predecessor
201-
; of its parent basic block after lowerswitch merged several cases into a new
201+
; of its parent basic block after lower-switch merged several cases into a new
202202
; default block.
203203
define void @test3(i32 %mode, i1 %c1, i1 %c2) {
204204
; CHECK-LABEL: @test3

0 commit comments

Comments
 (0)