Skip to content

Commit 1dd212f

Browse files
committedApr 11, 2016
[InstCombine] consolidate tests for related bugs
llvm-svn: 265973
1 parent c8753cb commit 1dd212f

File tree

2 files changed

+32
-26
lines changed

2 files changed

+32
-26
lines changed
 

‎llvm/test/Transforms/InstCombine/pr8547.ll

Lines changed: 0 additions & 26 deletions
This file was deleted.

‎llvm/test/Transforms/InstCombine/shift-shift.ll

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,35 @@ loop:
4141
br label %loop
4242
}
4343

44+
; Converting the 2 shifts to SHL 6 without the AND is wrong.
45+
; https://llvm.org/bugs/show_bug.cgi?id=8547
46+
47+
define i32 @pr8547(i32* %g) {
48+
; CHECK-LABEL: @pr8547(
49+
; CHECK-NEXT: codeRepl:
50+
; CHECK-NEXT: br label %for.cond
51+
; CHECK: for.cond:
52+
; CHECK-NEXT: [[STOREMERGE:%.*]] = phi i32 [ 0, %codeRepl ], [ 5, %for.cond ]
53+
; CHECK-NEXT: store i32 [[STOREMERGE]], i32* %g, align 4
54+
; CHECK-NEXT: [[TMP0:%.*]] = shl nuw nsw i32 [[STOREMERGE]], 6
55+
; CHECK-NEXT: [[CONV2:%.*]] = and i32 [[TMP0]], 64
56+
; CHECK-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[CONV2]], 0
57+
; CHECK-NEXT: br i1 [[TOBOOL]], label %for.cond, label %codeRepl2
58+
; CHECK: codeRepl2:
59+
; CHECK-NEXT: ret i32 [[CONV2]]
60+
;
61+
codeRepl:
62+
br label %for.cond
63+
64+
for.cond:
65+
%storemerge = phi i32 [ 0, %codeRepl ], [ 5, %for.cond ]
66+
store i32 %storemerge, i32* %g, align 4
67+
%shl = shl i32 %storemerge, 30
68+
%conv2 = lshr i32 %shl, 24
69+
%tobool = icmp eq i32 %conv2, 0
70+
br i1 %tobool, label %for.cond, label %codeRepl2
71+
72+
codeRepl2:
73+
ret i32 %conv2
74+
}
75+

0 commit comments

Comments
 (0)