brintos

brintos / llvm-project-archived public Read only

0
0
Text · 701 B · a9ca452 Raw
27 lines · plain
1; REQUIRES: asserts
2; RUN: opt -passes=slsr -S -debug-counter=slsr-counter=1  < %s | FileCheck %s
3
4; Test that, with debug counters on, we will skip the first slsr opportunity.
5
6define void @stride_is_2s(i32 %b, i32 %s) {
7; CHECK-LABEL: @stride_is_2s(
8; CHECK-NEXT: %s2 = shl i32 %s, 1
9; CHECK-NEXT: %t1 = add i32 %b, %s2
10; CHECK-NEXT: call void @foo(i32 %t1)
11; CHECK-NEXT: %s4 = shl i32 %s, 2
12; CHECK-NEXT: %t2 = add i32 %b, %s4
13; CHECK-NEXT: call void @foo(i32 %t2)
14; CHECK-NEXT: ret void
15;
16  %s2 = shl i32 %s, 1
17  %t1 = add i32 %b, %s2
18  call void @foo(i32 %t1)
19  %s4 = shl i32 %s, 2
20  %t2 = add i32 %b, %s4
21  call void @foo(i32 %t2)
22  ret void
23}
24
25declare void @foo(i32)
26
27