File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
llvm/test/Transforms/InstCombine 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 2
1
2
; RUN: opt -S < %s -passes=instcombine | FileCheck %s
2
3
3
4
target datalayout = "e-p1:16:16-p2:32:32-p3:64:64"
@@ -11,30 +12,34 @@ target datalayout = "e-p1:16:16-p2:32:32-p3:64:64"
11
12
12
13
define i64 @f1 () {
13
14
; This cannot be constant folded because G1 is underaligned.
14
- ; CHECK-LABEL: @f1(
15
- ; CHECK: ret i64 and
15
+ ; CHECK-LABEL: define i64 @f1() {
16
+ ; CHECK-NEXT: ret i64 and (i64 ptrtoint (ptr @G1 to i64), i64 1)
17
+ ;
16
18
ret i64 and (i64 ptrtoint (ptr @G1 to i64 ), i64 1 )
17
19
}
18
20
19
21
define i64 @f2 () {
20
22
; The preferred alignment for G2 allows this one to foled to zero.
21
- ; CHECK-LABEL: @f2(
22
- ; CHECK: ret i64 0
23
+ ; CHECK-LABEL: define i64 @f2() {
24
+ ; CHECK-NEXT: ret i64 0
25
+ ;
23
26
ret i64 and (i64 ptrtoint (ptr @G2 to i64 ), i64 1 )
24
27
}
25
28
26
29
define i64 @g1 () {
27
30
; This cannot be constant folded because A1 aliases G3 which is underalaigned.
28
- ; CHECK-LABEL: @g1(
29
- ; CHECK: ret i64 and
31
+ ; CHECK-LABEL: define i64 @g1() {
32
+ ; CHECK-NEXT: ret i64 and (i64 ptrtoint (ptr @A1 to i64), i64 1)
33
+ ;
30
34
ret i64 and (i64 ptrtoint (ptr @A1 to i64 ), i64 1 )
31
35
}
32
36
33
37
define i64 @g2 () {
34
38
; While A2 also aliases G3 which is underaligned, the math of A2 forces a
35
39
; certain alignment allowing this to fold to zero.
36
- ; CHECK-LABEL: @g2(
37
- ; CHECK: ret i64 0
40
+ ; CHECK-LABEL: define i64 @g2() {
41
+ ; CHECK-NEXT: ret i64 0
42
+ ;
38
43
ret i64 and (i64 ptrtoint (ptr @A2 to i64 ), i64 1 )
39
44
}
40
45
You can’t perform that action at this time.
0 commit comments