[llvm] 638d70b - [test, AArch64] Fix use of var defined in CHECK-NOT

Thomas Preud'homme via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 6 02:45:12 PDT 2021


Author: Thomas Preud'homme
Date: 2021-04-06T10:45:08+01:00
New Revision: 638d70be6b931c6ac5b7fefb9f3e866e4a89522c

URL: https://github.com/llvm/llvm-project/commit/638d70be6b931c6ac5b7fefb9f3e866e4a89522c
DIFF: https://github.com/llvm/llvm-project/commit/638d70be6b931c6ac5b7fefb9f3e866e4a89522c.diff

LOG: [test, AArch64] Fix use of var defined in CHECK-NOT

LLVM test CodeGen/AArch64/aarch64-tbz.ll tries to check for the absence
of a sequence of instructions with several CHECK-NOT with one of those
directives using a variable defined in another. However CHECK-NOT are
checked independently so that is using a variable defined in a pattern
that should not occur in the input.

This commit removes the definition and uses of variable to check each
line independently, making the check stronger than the current one. It
also removes unnecessary regex match for labels.

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D99602

Added: 
    

Modified: 
    llvm/test/CodeGen/AArch64/aarch64-tbz.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/AArch64/aarch64-tbz.ll b/llvm/test/CodeGen/AArch64/aarch64-tbz.ll
index ed9be77e5fea..8a57f9f9dc2d 100644
--- a/llvm/test/CodeGen/AArch64/aarch64-tbz.ll
+++ b/llvm/test/CodeGen/AArch64/aarch64-tbz.ll
@@ -4,8 +4,8 @@
 ; CHECK-LABEL: test1
 ; CHECK: tbz {{w[0-9]}}, #3, {{.LBB0_3}}
 ; CHECK: tbz w[[REG1:[0-9]+]], #2, {{.LBB0_3}}
-; CHECK-NOT: and [[REG2:x[0-9]+]], x[[REG1]], #0x4
-; CHECK-NOT: cbz [[REG2]], {{.LBB0_3}}
+; CHECK-NOT: and x{{[0-9]+}}, x[[REG1]], #0x4
+; CHECK-NOT: cbz x{{[0-9]+}}, .LBB0_3
 
 ; CHECK: b
 define void @test1(i64 %A, i64 %B) {
@@ -28,8 +28,8 @@ if.end3:                                          ; preds = %if.then2, %entry
 ; CHECK-LABEL: test2
 ; CHECK: cbz {{x[0-9]}}, {{.LBB1_3}}
 ; CHECK: tbz w[[REG1:[0-9]+]], #3, {{.LBB1_3}}
-; CHECK-NOT: and [REG2:x[0-9]+], x[[REG1]], #0x08
-; CHECK-NOT: cbz [[REG2]], {{.LBB1_3}}
+; CHECK-NOT: and x{{[0-9]+}}, x[[REG1]], #0x08
+; CHECK-NOT: cbz x{{[0-9]+}}, .LBB1_3
 
 define void @test2(i64 %A, i64* readonly %B) #0 {
 entry:
@@ -52,8 +52,8 @@ if.end3:                                          ; preds = %entry, %if.then2
 ; CHECK-LABEL: test3
 ; CHECK: tbz {{w[0-9]}}, #3, {{.LBB2_3}}
 ; CHECK: tbz w[[REG1:[0-9]+]], #28, {{.LBB2_3}}
-; CHECK-NOT: and [[REG2:x[0-9]+]], x[[REG1]]
-; CHECK-NOT: cbz [[REG2]], {{.LBB2_3}}
+; CHECK-NOT: and x{{[0-9]+}}, x[[REG1]]
+; CHECK-NOT: cbz x{{[0-9]+}}, .LBB2_3
 define void @test3(i64 %A, i64 %B) {
 entry:
   %shift = shl i64 1, 28
@@ -75,8 +75,8 @@ if.end3:                                          ; preds = %if.then2, %entry
 ; CHECK-LABEL: test4
 ; CHECK: tbz {{w[0-9]}}, #3, {{.LBB3_3}}
 ; CHECK: tbz [[REG1:x[0-9]+]], #35, {{.LBB3_3}}
-; CHECK-NOT: and [[REG2:x[0-9]+]], x[[REG1]]
-; CHECK-NOT: cbz [[REG2]], {{.LBB2_3}}
+; CHECK-NOT: and x{{[0-9]+}}, x[[REG1]]
+; CHECK-NOT: cbz x{{[0-9]+}}, .LBB2_3
 define void @test4(i64 %A, i64 %B) {
 entry:
   %shift = shl i64 1, 35


        


More information about the llvm-commits mailing list