Skip to content

Commit 1d70fd4

Browse files
Thomas Preud'hommememfrob
authored andcommitted
[test, ARM] Fix use of var defined in CHECK-NOT
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. LLVM test CodeGenPrepare/ARM/sink-add-mul-shufflevector.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. The bug was then copied over in Transforms/CodeGenPrepare/ARM/sink-add-mul-shufflevector-inseltpoison.ll This commit removes the definition and uses of variable to check each line independently, making the check stronger than the current one. Reviewed By: dmgreen Differential Revision: https://reviews.llvm.org/D99597
1 parent 93f6eb0 commit 1d70fd4

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

llvm/test/Transforms/CodeGenPrepare/ARM/sink-add-mul-shufflevector-inseltpoison.ll

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
define void @sink_add_mul(i32* %s1, i32 %x, i32* %d, i32 %n) {
44
; CHECK-LABEL: @sink_add_mul(
55
; CHECK: vector.ph:
6-
; CHECK-NOT: [[BROADCAST_SPLATINSERT8:%.*]] = insertelement <4 x i32> undef, i32 [[X:%.*]], i32 0
7-
; CHECK-NOT: [[BROADCAST_SPLAT9:%.*]] = shufflevector <4 x i32> [[BROADCAST_SPLATINSERT8]], <4 x i32> poison, <4 x i32> zeroinitializer
6+
; CHECK-NOT: %{{.*}} = insertelement <4 x i32> undef, i32 %{{.*}}, i32 0
7+
; CHECK-NOT: %{{.*}} = shufflevector <4 x i32> %{{.*}}, <4 x i32> poison, <4 x i32> zeroinitializer
88
; CHECK: vector.body:
99
; CHECK: [[TMP2:%.*]] = insertelement <4 x i32> poison, i32 [[X:%.*]], i32 0
1010
; CHECK: [[TMP3:%.*]] = shufflevector <4 x i32> [[TMP2]], <4 x i32> poison, <4 x i32> zeroinitializer
@@ -42,8 +42,8 @@ for.cond.cleanup: ; preds = %for.body, %middle.b
4242
define void @sink_add_mul_multiple(i32* %s1, i32* %s2, i32 %x, i32* %d, i32* %d2, i32 %n) {
4343
; CHECK-LABEL: @sink_add_mul_multiple(
4444
; CHECK: vector.ph:
45-
; CHECK-NOT: [[BROADCAST_SPLATINSERT8:%.*]] = insertelement <4 x i32> undef, i32 [[X:%.*]], i32 0
46-
; CHECK-NOT: [[BROADCAST_SPLAT9:%.*]] = shufflevector <4 x i32> [[BROADCAST_SPLATINSERT8]], <4 x i32> poison, <4 x i32> zeroinitializer
45+
; CHECK-NOT: %{{.*}} = insertelement <4 x i32> undef, i32 %{{.*}}, i32 0
46+
; CHECK-NOT: %{{.*}} = shufflevector <4 x i32> %{{.*}}, <4 x i32> poison, <4 x i32> zeroinitializer
4747
; CHECK: vector.body:
4848
; CHECK: [[TMP2:%.*]] = insertelement <4 x i32> poison, i32 %x, i32 0
4949
; CHECK: [[TMP3:%.*]] = shufflevector <4 x i32> [[TMP2]], <4 x i32> poison, <4 x i32> zeroinitializer
@@ -147,8 +147,8 @@ for.cond.cleanup: ; preds = %for.body, %middle.b
147147
define void @sink_sub(i32* %s1, i32 %x, i32* %d, i32 %n) {
148148
; CHECK-LABEL: @sink_sub(
149149
; CHECK: vector.ph:
150-
; CHECK-NOT: [[BROADCAST_SPLATINSERT8:%.*]] = insertelement <4 x i32> poison, i32 [[X:%.*]], i32 0
151-
; CHECK-NOT: [[BROADCAST_SPLAT9:%.*]] = shufflevector <4 x i32> [[BROADCAST_SPLATINSERT8]], <4 x i32> poison, <4 x i32> zeroinitializer
150+
; CHECK-NOT: %{{.*}} = insertelement <4 x i32> poison, i32 %{{.*}}, i32 0
151+
; CHECK-NOT: %{{.*}} = shufflevector <4 x i32> %{{.*}}, <4 x i32> poison, <4 x i32> zeroinitializer
152152
; CHECK: vector.body:
153153
; CHECK: [[TMP2:%.*]] = insertelement <4 x i32> poison, i32 [[X:%.*]], i32 0
154154
; CHECK: [[TMP3:%.*]] = shufflevector <4 x i32> [[TMP2]], <4 x i32> poison, <4 x i32> zeroinitializer
@@ -189,8 +189,8 @@ entry:
189189
; CHECK-NEXT: [[BROADCAST_SPLAT16:%.*]] = shufflevector <4 x i32> [[BROADCAST_SPLATINSERT15]], <4 x i32> poison, <4 x i32> zeroinitializer
190190
; CHECK-NEXT: br label [[VECTOR_BODY:%.*]]
191191
; CHECK: vector.body:
192-
; CHECK-NOT: [[TMP2:%.*]] = insertelement <4 x i32> poison, i32 [[X:%.*]], i32 0
193-
; CHECK-NOT: [[TMP3:%.*]] = shufflevector <4 x i32> [[TMP2]], <4 x i32> poison, <4 x i32> zeroinitializer
192+
; CHECK-NOT: %{{.*}} = insertelement <4 x i32> poison, i32 %{{.*}}, i32 0
193+
; CHECK-NOT: %{{.*}} = shufflevector <4 x i32> %{{.*}}, <4 x i32> poison, <4 x i32> zeroinitializer
194194
;
195195
%cmp6 = icmp sgt i32 %n, 0
196196
br i1 %cmp6, label %vector.ph, label %for.cond.cleanup

llvm/test/Transforms/CodeGenPrepare/ARM/sink-add-mul-shufflevector.ll

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
define void @sink_add_mul(i32* %s1, i32 %x, i32* %d, i32 %n) {
44
; CHECK-LABEL: @sink_add_mul(
55
; CHECK: vector.ph:
6-
; CHECK-NOT: [[BROADCAST_SPLATINSERT8:%.*]] = insertelement <4 x i32> undef, i32 [[X:%.*]], i32 0
7-
; CHECK-NOT: [[BROADCAST_SPLAT9:%.*]] = shufflevector <4 x i32> [[BROADCAST_SPLATINSERT8]], <4 x i32> undef, <4 x i32> zeroinitializer
6+
; CHECK-NOT: %{{.*}} = insertelement <4 x i32> undef, i32 %{{.*}}, i32 0
7+
; CHECK-NOT: %{{.*}} = shufflevector <4 x i32> %{{.*}}, <4 x i32> undef, <4 x i32> zeroinitializer
88
; CHECK: vector.body:
99
; CHECK: [[TMP2:%.*]] = insertelement <4 x i32> undef, i32 [[X:%.*]], i32 0
1010
; CHECK: [[TMP3:%.*]] = shufflevector <4 x i32> [[TMP2]], <4 x i32> undef, <4 x i32> zeroinitializer
@@ -42,8 +42,8 @@ for.cond.cleanup: ; preds = %for.body, %middle.b
4242
define void @sink_add_mul_multiple(i32* %s1, i32* %s2, i32 %x, i32* %d, i32* %d2, i32 %n) {
4343
; CHECK-LABEL: @sink_add_mul_multiple(
4444
; CHECK: vector.ph:
45-
; CHECK-NOT: [[BROADCAST_SPLATINSERT8:%.*]] = insertelement <4 x i32> undef, i32 [[X:%.*]], i32 0
46-
; CHECK-NOT: [[BROADCAST_SPLAT9:%.*]] = shufflevector <4 x i32> [[BROADCAST_SPLATINSERT8]], <4 x i32> undef, <4 x i32> zeroinitializer
45+
; CHECK-NOT: %{{.*}} = insertelement <4 x i32> undef, i32 %{{.*}}, i32 0
46+
; CHECK-NOT: %{{.*}} = shufflevector <4 x i32> %{{.*}}, <4 x i32> undef, <4 x i32> zeroinitializer
4747
; CHECK: vector.body:
4848
; CHECK: [[TMP2:%.*]] = insertelement <4 x i32> undef, i32 %x, i32 0
4949
; CHECK: [[TMP3:%.*]] = shufflevector <4 x i32> [[TMP2]], <4 x i32> undef, <4 x i32> zeroinitializer
@@ -147,8 +147,8 @@ for.cond.cleanup: ; preds = %for.body, %middle.b
147147
define void @sink_sub(i32* %s1, i32 %x, i32* %d, i32 %n) {
148148
; CHECK-LABEL: @sink_sub(
149149
; CHECK: vector.ph:
150-
; CHECK-NOT: [[BROADCAST_SPLATINSERT8:%.*]] = insertelement <4 x i32> undef, i32 [[X:%.*]], i32 0
151-
; CHECK-NOT: [[BROADCAST_SPLAT9:%.*]] = shufflevector <4 x i32> [[BROADCAST_SPLATINSERT8]], <4 x i32> undef, <4 x i32> zeroinitializer
150+
; CHECK-NOT: %{{.*}} = insertelement <4 x i32> undef, i32 %{{.*}}, i32 0
151+
; CHECK-NOT: %{{.*}} = shufflevector <4 x i32> %{{.*}}, <4 x i32> undef, <4 x i32> zeroinitializer
152152
; CHECK: vector.body:
153153
; CHECK: [[TMP2:%.*]] = insertelement <4 x i32> undef, i32 [[X:%.*]], i32 0
154154
; CHECK: [[TMP3:%.*]] = shufflevector <4 x i32> [[TMP2]], <4 x i32> undef, <4 x i32> zeroinitializer
@@ -189,8 +189,8 @@ entry:
189189
; CHECK-NEXT: [[BROADCAST_SPLAT16:%.*]] = shufflevector <4 x i32> [[BROADCAST_SPLATINSERT15]], <4 x i32> undef, <4 x i32> zeroinitializer
190190
; CHECK-NEXT: br label [[VECTOR_BODY:%.*]]
191191
; CHECK: vector.body:
192-
; CHECK-NOT: [[TMP2:%.*]] = insertelement <4 x i32> undef, i32 [[X:%.*]], i32 0
193-
; CHECK-NOT: [[TMP3:%.*]] = shufflevector <4 x i32> [[TMP2]], <4 x i32> undef, <4 x i32> zeroinitializer
192+
; CHECK-NOT: %{{.*}} = insertelement <4 x i32> undef, i32 %{{.*}}, i32 0
193+
; CHECK-NOT: %{{.*}} = shufflevector <4 x i32> %{{.*}}, <4 x i32> undef, <4 x i32> zeroinitializer
194194
;
195195
%cmp6 = icmp sgt i32 %n, 0
196196
br i1 %cmp6, label %vector.ph, label %for.cond.cleanup

0 commit comments

Comments
 (0)