Skip to content

Commit e323dae

Browse files
committed
[LoopIdom] Add pre-commit crash for crc with DL
1 parent 45ce887 commit e323dae

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
; REQUIRES: asserts
2+
; RUN: not --crash opt -passes=loop-idiom -S %s
3+
4+
target datalayout = "p:16:16"
5+
6+
define void @test_with_dl() {
7+
entry:
8+
br label %ph
9+
10+
ph:
11+
%crc.use = phi i32 [ 0, %entry ], [ %crc.next, %loop ]
12+
br label %loop
13+
14+
loop:
15+
%iv = phi i16 [ 0, %ph ], [ %iv.next, %loop ]
16+
%crc = phi i32 [ 0, %ph ], [ %crc.next, %loop ]
17+
%lshr.crc.1 = lshr i32 %crc, 1
18+
%crc.and.1 = and i32 %crc, 1
19+
%sb.check = icmp eq i32 %crc.and.1, 0
20+
%xor = xor i32 %lshr.crc.1, 0
21+
%crc.next = select i1 %sb.check, i32 %lshr.crc.1, i32 %xor
22+
%iv.next = add i16 %iv, 1
23+
%exit.cond = icmp ult i16 %iv, 7
24+
br i1 %exit.cond, label %loop, label %ph
25+
}

0 commit comments

Comments
 (0)