Skip to content

Commit 2149811

Browse files
[NFC] Make tests more robust for new optimizations
llvm-svn: 361697
1 parent 91131b6 commit 2149811

File tree

6 files changed

+23
-13
lines changed

6 files changed

+23
-13
lines changed

llvm/test/CodeGen/ARM/crash-greedy.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ target triple = "thumbv7-apple-darwin"
77
declare double @exp(double)
88

99
; CHECK: remat_subreg
10-
define void @remat_subreg(float* nocapture %x, i32* %y, i32 %n, i32 %z, float %c, float %lambda, float* nocapture %ret_f, float* nocapture %ret_df) nounwind {
10+
define void @remat_subreg(float* nocapture %x, i32* %y, i32 %n, i32 %z, float %c, float %lambda, float* nocapture %ret_f, float* nocapture %ret_df, i1 %cond) nounwind {
1111
entry:
1212
%conv16 = fpext float %lambda to double
1313
%mul17 = fmul double %conv16, -1.000000e+00
14-
br i1 undef, label %cond.end.us, label %cond.end
14+
br i1 %cond, label %cond.end.us, label %cond.end
1515

1616
cond.end.us: ; preds = %entry
1717
unreachable

llvm/test/CodeGen/Hexagon/bit-visit-flowq.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@ target triple = "hexagon"
99
@debug = external hidden unnamed_addr global i1, align 4
1010

1111
; Function Attrs: nounwind
12-
define void @foo() local_unnamed_addr #0 {
12+
define void @foo(i1 %cond) local_unnamed_addr #0 {
1313
entry:
1414
br label %if.end5
1515

1616
if.end5: ; preds = %entry
1717
br i1 undef, label %if.then12, label %if.end13
1818

1919
if.then12: ; preds = %if.end5
20-
unreachable
20+
ret void
2121

2222
if.end13: ; preds = %if.end5
2323
br label %for.cond
2424

2525
for.cond: ; preds = %if.end13
2626
%or.cond288 = or i1 undef, undef
27-
br i1 undef, label %if.then44, label %if.end51
27+
br i1 %cond, label %if.then44, label %if.end51
2828

2929
if.then44: ; preds = %for.cond
3030
tail call void @bar() #0

llvm/test/CodeGen/Hexagon/rdf-ignore-undef.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ if.end88.do.body_crit_edge: ; preds = %if.end88
4949
br label %do.body
5050

5151
if.then124: ; preds = %if.end88, %do.body
52-
unreachable
52+
ret i32 0
5353
}
5454

5555
attributes #0 = { nounwind }

llvm/test/CodeGen/Hexagon/reg-scavengebug.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ declare <16 x i32> @llvm.hexagon.V6.valignb(<16 x i32>, <16 x i32>, i32) #0
1919
declare <16 x i32> @llvm.hexagon.V6.vaddh(<16 x i32>, <16 x i32>) #0
2020

2121
; Function Attrs: nounwind
22-
define void @f0(i16* noalias nocapture %a0, i32* noalias nocapture readonly %a1, i32 %a2, i8* noalias nocapture readonly %a3) #1 {
22+
define void @f0(i16* noalias nocapture %a0, i32* noalias nocapture readonly %a1, i32 %a2, i8* noalias nocapture readonly %a3, i1 %cond) #1 {
2323
b0:
2424
%v0 = add nsw i32 %a2, 63
2525
%v1 = ashr i32 %v0, 6
@@ -40,7 +40,7 @@ b1: ; preds = %b0
4040
%v13 = getelementptr inbounds i32, i32* %a1, i32 48
4141
%v14 = tail call <16 x i32> @llvm.hexagon.V6.vaddh(<16 x i32> %v12, <16 x i32> undef)
4242
%v15 = bitcast i32* %v13 to <16 x i32>*
43-
br i1 undef, label %b2, label %b3
43+
br i1 %cond, label %b2, label %b3
4444

4545
b2: ; preds = %b1
4646
%v16 = getelementptr inbounds <16 x i32>, <16 x i32>* %v15, i32 1

llvm/test/CodeGen/Hexagon/regalloc-block-overlap.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ declare <32 x i32> @llvm.hexagon.V6.vasrwhsat.128B(<32 x i32>, <32 x i32>, i32)
1616
declare <64 x i32> @llvm.hexagon.V6.vlutvwh.128B(<32 x i32>, <32 x i32>, i32) #1
1717
declare <64 x i32> @llvm.hexagon.V6.vlutvwh.oracc.128B(<64 x i32>, <32 x i32>, <32 x i32>, i32) #1
1818

19-
define hidden void @fred(<32 x i32>* %a0, i32 %a1) #0 {
19+
define hidden void @fred(<32 x i32>* %a0, i32 %a1, i1 %cond) #0 {
2020
b0:
2121
%v1 = ashr i32 %a1, 7
2222
%v2 = shl nsw i32 %v1, 7
@@ -70,7 +70,7 @@ b15: ; preds = %b14
7070
br label %b16
7171

7272
b16: ; preds = %b15
73-
br i1 undef, label %b17, label %b18
73+
br i1 %cond, label %b17, label %b18
7474

7575
b17: ; preds = %b16
7676
unreachable

llvm/test/Transforms/LoopVectorize/if-pred-stores.ll

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,11 @@ for.end:
194194
; vectorized loop body.
195195
; PR18724
196196

197-
define void @bug18724() {
197+
define void @bug18724(i1 %cond) {
198198
; UNROLL-LABEL: @bug18724(
199199
; UNROLL-NEXT: entry:
200+
; UNROLL-NEXT: [[TMP0:%.*]] = xor i1 [[COND:%.*]], true
201+
; UNROLL-NEXT: call void @llvm.assume(i1 [[TMP0]])
200202
; UNROLL-NEXT: br label [[FOR_BODY14:%.*]]
201203
; UNROLL: for.body14:
202204
; UNROLL-NEXT: [[INDVARS_IV3:%.*]] = phi i64 [ [[INDVARS_IV_NEXT4:%.*]], [[FOR_INC23:%.*]] ], [ undef, [[ENTRY:%.*]] ]
@@ -211,13 +213,16 @@ define void @bug18724() {
211213
; UNROLL: for.inc23:
212214
; UNROLL-NEXT: [[INEWCHUNKS_2]] = phi i32 [ [[INC21]], [[IF_THEN18]] ], [ [[INEWCHUNKS_120]], [[FOR_BODY14]] ]
213215
; UNROLL-NEXT: [[INDVARS_IV_NEXT4]] = add nsw i64 [[INDVARS_IV3]], 1
216+
; UNROLL-NEXT: [[TMP1:%.*]] = trunc i64 [[INDVARS_IV3]] to i32
217+
; UNROLL-NEXT: [[CMP13:%.*]] = icmp slt i32 [[TMP1]], 0
218+
; UNROLL-NEXT: call void @llvm.assume(i1 [[CMP13]])
214219
; UNROLL-NEXT: br label [[FOR_BODY14]]
215220
;
216221
; UNROLL-NOSIMPLIFY-LABEL: @bug18724(
217222
; UNROLL-NOSIMPLIFY-NEXT: entry:
218223
; UNROLL-NOSIMPLIFY-NEXT: br label [[FOR_BODY9:%.*]]
219224
; UNROLL-NOSIMPLIFY: for.body9:
220-
; UNROLL-NOSIMPLIFY-NEXT: br i1 undef, label [[FOR_INC26:%.*]], label [[FOR_BODY14_PREHEADER:%.*]]
225+
; UNROLL-NOSIMPLIFY-NEXT: br i1 [[COND:%.*]], label [[FOR_INC26:%.*]], label [[FOR_BODY14_PREHEADER:%.*]]
221226
; UNROLL-NOSIMPLIFY: for.body14.preheader:
222227
; UNROLL-NOSIMPLIFY-NEXT: br i1 true, label [[SCALAR_PH:%.*]], label [[VECTOR_PH:%.*]]
223228
; UNROLL-NOSIMPLIFY: vector.ph:
@@ -287,6 +292,8 @@ define void @bug18724() {
287292
;
288293
; VEC-LABEL: @bug18724(
289294
; VEC-NEXT: entry:
295+
; VEC-NEXT: [[TMP0:%.*]] = xor i1 [[COND:%.*]], true
296+
; VEC-NEXT: call void @llvm.assume(i1 [[TMP0]])
290297
; VEC-NEXT: br label [[FOR_BODY14:%.*]]
291298
; VEC: for.body14:
292299
; VEC-NEXT: [[INDVARS_IV3:%.*]] = phi i64 [ [[INDVARS_IV_NEXT4:%.*]], [[FOR_INC23:%.*]] ], [ undef, [[ENTRY:%.*]] ]
@@ -301,13 +308,16 @@ define void @bug18724() {
301308
; VEC: for.inc23:
302309
; VEC-NEXT: [[INEWCHUNKS_2]] = phi i32 [ [[INC21]], [[IF_THEN18]] ], [ [[INEWCHUNKS_120]], [[FOR_BODY14]] ]
303310
; VEC-NEXT: [[INDVARS_IV_NEXT4]] = add nsw i64 [[INDVARS_IV3]], 1
311+
; VEC-NEXT: [[TMP1:%.*]] = trunc i64 [[INDVARS_IV3]] to i32
312+
; VEC-NEXT: [[CMP13:%.*]] = icmp slt i32 [[TMP1]], 0
313+
; VEC-NEXT: call void @llvm.assume(i1 [[CMP13]])
304314
; VEC-NEXT: br label [[FOR_BODY14]]
305315
;
306316
entry:
307317
br label %for.body9
308318

309319
for.body9:
310-
br i1 undef, label %for.inc26, label %for.body14
320+
br i1 %cond, label %for.inc26, label %for.body14
311321

312322
for.body14:
313323
%indvars.iv3 = phi i64 [ %indvars.iv.next4, %for.inc23 ], [ undef, %for.body9 ]

0 commit comments

Comments
 (0)