File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
llvm/test/Transforms/Reassociate Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change 1+ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2+ ; RUN: opt < %s -passes=reassociate,instcombine -S | FileCheck %s
3+
14; With shl->mul reassociation, we can see that this is (shl A, 9) * A
5+ define i32 @test (i32 %A ) {
6+ ; CHECK-LABEL: define i32 @test(
7+ ; CHECK-SAME: i32 [[A:%.*]]) {
8+ ; CHECK-NEXT: [[Y:%.*]] = shl i32 [[A]], 9
9+ ; CHECK-NEXT: [[Z:%.*]] = mul i32 [[Y]], [[A]]
10+ ; CHECK-NEXT: ret i32 [[Z]]
211;
3- ; RUN: opt < %s -passes=reassociate,instcombine -S |\
4- ; RUN: grep "shl .*, 9"
5-
6- define i32 @test (i32 %A , i32 %B ) {
7- %X = shl i32 %A , 5 ; <i32> [#uses=1]
8- %Y = shl i32 %A , 4 ; <i32> [#uses=1]
9- %Z = mul i32 %Y , %X ; <i32> [#uses=1]
10- ret i32 %Z
12+ %X = shl i32 %A , 5 ; <i32> [#uses=1]
13+ %Y = shl i32 %A , 4 ; <i32> [#uses=1]
14+ %Z = mul i32 %Y , %X ; <i32> [#uses=1]
15+ ret i32 %Z
1116}
1217
You can’t perform that action at this time.
0 commit comments