File tree 1 file changed +10
-5
lines changed
llvm/test/Transforms/InstCombine
1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change
1
+ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
1
2
; RUN: opt < %s -instcombine -S | FileCheck %s
3
+
2
4
define i32 @foo (i32 %x , i32 %y ) {
3
5
; CHECK-LABEL: @foo(
6
+ ; CHECK-NEXT: [[RES:%.*]] = mul i32 [[X:%.*]], [[Y:%.*]]
7
+ ; CHECK-NEXT: ret i32 [[RES]]
8
+ ;
4
9
%add = add nsw i32 %y , %x
5
10
%mul = mul nsw i32 %add , %y
6
11
%square = mul nsw i32 %y , %y
7
12
%res = sub i32 %mul , %square
8
13
ret i32 %res
9
- ; CHECK-NEXT: mul i32 %x, %y
10
- ; CHECK-NEXT: ret i32
11
14
}
12
15
13
16
define i1 @bar (i64 %x , i64 %y ) {
14
17
; CHECK-LABEL: @bar(
18
+ ; CHECK-NEXT: [[TMP1:%.*]] = xor i64 [[X:%.*]], -1
19
+ ; CHECK-NEXT: [[B:%.*]] = and i64 [[TMP1]], [[Y:%.*]]
20
+ ; CHECK-NEXT: [[R:%.*]] = icmp eq i64 [[B]], 0
21
+ ; CHECK-NEXT: ret i1 [[R]]
22
+ ;
15
23
%a = and i64 %y , %x
16
- ; CHECK: and
17
- ; CHECK-NOT: and
18
24
%not = xor i64 %a , -1
19
25
%b = and i64 %y , %not
20
26
%r = icmp eq i64 %b , 0
21
27
ret i1 %r
22
- ; CHECK: ret i1
23
28
}
You can’t perform that action at this time.
0 commit comments