[llvm] c68caff - Use autogenerated result for switch-bt.ll test; NFC
Noah Goldstein via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 31 23:26:40 PST 2023
Author: Noah Goldstein
Date: 2023-02-01T01:26:06-06:00
New Revision: c68caff2e9b1ed28b5e7df68de6dd70b0ca2da4b
URL: https://github.com/llvm/llvm-project/commit/c68caff2e9b1ed28b5e7df68de6dd70b0ca2da4b
DIFF: https://github.com/llvm/llvm-project/commit/c68caff2e9b1ed28b5e7df68de6dd70b0ca2da4b.diff
LOG: Use autogenerated result for switch-bt.ll test; NFC
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D142860
Added:
Modified:
llvm/test/CodeGen/X86/switch-bt.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/X86/switch-bt.ll b/llvm/test/CodeGen/X86/switch-bt.ll
index 44347059d568..f5b74082eac9 100644
--- a/llvm/test/CodeGen/X86/switch-bt.ll
+++ b/llvm/test/CodeGen/X86/switch-bt.ll
@@ -1,18 +1,44 @@
-; RUN: llc -mtriple=x86_64-- -asm-verbose=false < %s -jump-table-density=40 -switch-peel-threshold=101 | FileCheck %s
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc -mtriple=x86_64-- < %s -jump-table-density=40 -switch-peel-threshold=101 | FileCheck %s
; This switch should use bit tests, and the third bit test case is just
; testing for one possible value, so it doesn't need a bt.
-; CHECK: movabsq $2305843009482129440, %r
-; CHECK-NEXT: btq %rax, %r
-; CHECK-NEXT: jb
-; CHECK: movl $671088640, %e
-; CHECK-NEXT: btq %rax, %r
-; CHECK-NEXT: jae
-; CHECK: testq %rax, %r
-; CHECK-NEXT: j
-
define void @test(ptr %l) nounwind {
+; CHECK-LABEL: test:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: pushq %rax
+; CHECK-NEXT: movq %rdi, (%rsp)
+; CHECK-NEXT: movsbl (%rdi), %eax
+; CHECK-NEXT: addl $-33, %eax
+; CHECK-NEXT: cmpl $61, %eax
+; CHECK-NEXT: ja .LBB0_7
+; CHECK-NEXT: # %bb.1: # %entry
+; CHECK-NEXT: movabsq $2305843009482129440, %rcx # imm = 0x2000000010000020
+; CHECK-NEXT: btq %rax, %rcx
+; CHECK-NEXT: jb .LBB0_6
+; CHECK-NEXT: # %bb.2: # %entry
+; CHECK-NEXT: movl $671088640, %ecx # imm = 0x28000000
+; CHECK-NEXT: btq %rax, %rcx
+; CHECK-NEXT: jae .LBB0_3
+; CHECK-NEXT: # %bb.5: # %sw.bb
+; CHECK-NEXT: xorl %edi, %edi
+; CHECK-NEXT: jmp .LBB0_8
+; CHECK-NEXT: .LBB0_6: # %sw.bb2
+; CHECK-NEXT: movl $1, %edi
+; CHECK-NEXT: jmp .LBB0_8
+; CHECK-NEXT: .LBB0_3: # %entry
+; CHECK-NEXT: testq %rax, %rax
+; CHECK-NEXT: jne .LBB0_7
+; CHECK-NEXT: # %bb.4: # %sw.bb4
+; CHECK-NEXT: movl $3, %edi
+; CHECK-NEXT: jmp .LBB0_8
+; CHECK-NEXT: .LBB0_7: # %sw.default
+; CHECK-NEXT: movl $97, %edi
+; CHECK-NEXT: .LBB0_8: # %sw.epilog
+; CHECK-NEXT: callq foo at PLT
+; CHECK-NEXT: popq %rax
+; CHECK-NEXT: retq
entry:
%l.addr = alloca ptr, align 8 ; <ptr> [#uses=2]
store ptr %l, ptr %l.addr
@@ -54,13 +80,18 @@ declare void @foo(i32)
; rdar://8781238
define void @test2(i32 %x) nounwind ssp {
; CHECK-LABEL: test2:
-; CHECK: cmpl $6
-; CHECK: ja
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: cmpl $6, %edi
+; CHECK-NEXT: ja .LBB1_2
+; CHECK-NEXT: # %bb.1: # %entry
+; CHECK-NEXT: movl $91, %eax
+; CHECK-NEXT: btl %edi, %eax
+; CHECK-NEXT: jae .LBB1_2
+; CHECK-NEXT: # %bb.3: # %if.then
+; CHECK-NEXT: jmp bar at PLT # TAILCALL
+; CHECK-NEXT: .LBB1_2: # %if.end
+; CHECK-NEXT: retq
-; CHECK-NEXT: movl $91
-; CHECK-NOT: movl
-; CHECK-NEXT: btl
-; CHECK-NEXT: jae
entry:
switch i32 %x, label %if.end [
i32 6, label %if.then
@@ -82,10 +113,16 @@ declare void @bar()
define void @test3(i32 %x) nounwind {
; CHECK-LABEL: test3:
-; CHECK: cmpl $5
-; CHECK: ja
-; CHECK: cmpl $4
-; CHECK: je
+; CHECK: # %bb.0:
+; CHECK-NEXT: cmpl $5, %edi
+; CHECK-NEXT: ja .LBB2_2
+; CHECK-NEXT: # %bb.1:
+; CHECK-NEXT: cmpl $4, %edi
+; CHECK-NEXT: je .LBB2_2
+; CHECK-NEXT: # %bb.3: # %if.then
+; CHECK-NEXT: jmp bar at PLT # TAILCALL
+; CHECK-NEXT: .LBB2_2: # %if.end
+; CHECK-NEXT: retq
switch i32 %x, label %if.end [
i32 0, label %if.then
i32 1, label %if.then
@@ -104,6 +141,48 @@ if.end:
; created binary tree search. See PR22262.
define void @test4(i32 %x, ptr %y) {
; CHECK-LABEL: test4:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: cmpl $39, %edi
+; CHECK-NEXT: jg .LBB3_5
+; CHECK-NEXT: # %bb.1: # %entry
+; CHECK-NEXT: cmpl $10, %edi
+; CHECK-NEXT: je .LBB3_9
+; CHECK-NEXT: # %bb.2: # %entry
+; CHECK-NEXT: cmpl $20, %edi
+; CHECK-NEXT: je .LBB3_10
+; CHECK-NEXT: # %bb.3: # %entry
+; CHECK-NEXT: cmpl $30, %edi
+; CHECK-NEXT: jne .LBB3_13
+; CHECK-NEXT: # %bb.4: # %sw.bb2
+; CHECK-NEXT: movl $3, (%rsi)
+; CHECK-NEXT: retq
+; CHECK-NEXT: .LBB3_5: # %entry
+; CHECK-NEXT: cmpl $40, %edi
+; CHECK-NEXT: je .LBB3_11
+; CHECK-NEXT: # %bb.6: # %entry
+; CHECK-NEXT: cmpl $50, %edi
+; CHECK-NEXT: je .LBB3_12
+; CHECK-NEXT: # %bb.7: # %entry
+; CHECK-NEXT: cmpl $60, %edi
+; CHECK-NEXT: jne .LBB3_13
+; CHECK-NEXT: # %bb.8: # %sw.bb5
+; CHECK-NEXT: movl $6, (%rsi)
+; CHECK-NEXT: retq
+; CHECK-NEXT: .LBB3_9: # %sw.bb
+; CHECK-NEXT: movl $1, (%rsi)
+; CHECK-NEXT: retq
+; CHECK-NEXT: .LBB3_10: # %sw.bb1
+; CHECK-NEXT: movl $2, (%rsi)
+; CHECK-NEXT: retq
+; CHECK-NEXT: .LBB3_11: # %sw.bb3
+; CHECK-NEXT: movl $4, (%rsi)
+; CHECK-NEXT: retq
+; CHECK-NEXT: .LBB3_12: # %sw.bb4
+; CHECK-NEXT: movl $5, (%rsi)
+; CHECK-NEXT: retq
+; CHECK-NEXT: .LBB3_13: # %sw.default
+; CHECK-NEXT: movl $7, (%rsi)
+; CHECK-NEXT: retq
entry:
switch i32 %x, label %sw.default [
@@ -140,47 +219,41 @@ sw.epilog:
; The balanced binary switch here would start with a comparison against 39, but
; it is currently starting with 29 because of the density-sum heuristic.
-; CHECK: cmpl $39
-; CHECK: jg
-; CHECK: cmpl $10
-; CHECK: je
-; CHECK: cmpl $20
-; CHECK: je
-; CHECK: cmpl $30
-; CHECK: jne
-; CHECK: cmpl $40
-; CHECK: je
-; CHECK: cmpl $50
-; CHECK: je
-; CHECK: cmpl $60
-; CHECK: jne
}
; Omit the range check when the default case is unreachable, see PR43129.
declare void @g(i32)
define void @test5(i32 %x) {
-
-; CHECK-LABEL: test5
-; CHECK-NOT: cmp
-
-; 73 = 2^0 + 2^3 + 2^6
-; CHECK: movl $73
-; CHECK-NEXT: btl
-; CHECK-NEXT: jb
-
-; 146 = 2^1 + 2^4 + 2^7
-; CHECK-NEXT: movl $146
-; CHECK-NEXT: btl
-; CHECK-NEXT: jae
-
+; CHECK-LABEL: test5:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: pushq %rax
+; CHECK-NEXT: .cfi_def_cfa_offset 16
+; CHECK-NEXT: movl $73, %eax
+; CHECK-NEXT: btl %edi, %eax
+; CHECK-NEXT: jb .LBB4_3
+; CHECK-NEXT: # %bb.1: # %entry
+; CHECK-NEXT: movl $146, %eax
+; CHECK-NEXT: btl %edi, %eax
+; CHECK-NEXT: jae .LBB4_2
+; CHECK-NEXT: # %bb.4: # %bb1
+; CHECK-NEXT: movl $1, %edi
+; CHECK-NEXT: callq g at PLT
+; CHECK-NEXT: .LBB4_3: # %bb0
+; CHECK-NEXT: xorl %edi, %edi
+; CHECK-NEXT: callq g at PLT
+; CHECK-NEXT: .LBB4_2: # %bb2
+; CHECK-NEXT: movl $2, %edi
+; CHECK-NEXT: callq g at PLT
entry:
switch i32 %x, label %return [
+ ; 73 = 2^0 + 2^3 + 2^6
i32 0, label %bb0
i32 3, label %bb0
i32 6, label %bb0
+ ; 146 = 2^1 + 2^4 + 2^7
i32 1, label %bb1
i32 4, label %bb1
i32 7, label %bb1
More information about the llvm-commits
mailing list