1
1
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2
- ; RUN: opt < %s -passes=instcombine -S | FileCheck %s
2
+ ; RUN: opt < %s -passes=' instcombine<max-iterations=2>' -S | FileCheck %s
3
3
4
4
target datalayout = "e-p:64:64:64-p1:16:16:16-p2:32:32:32-p3:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
5
5
6
6
declare void @use_ptr (ptr )
7
7
8
8
define i1 @inttoptr (i64 %x , i64 %y ) {
9
9
; CHECK-LABEL: @inttoptr(
10
- ; CHECK-NEXT: [[XPTR:%.*]] = inttoptr i64 [[X:%.*]] to ptr
11
- ; CHECK-NEXT: [[YPTR:%.*]] = inttoptr i64 [[Y:%.*]] to ptr
12
- ; CHECK-NEXT: [[CMP:%.*]] = icmp eq ptr [[XPTR]], [[YPTR]]
10
+ ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i64 [[X:%.*]], [[Y:%.*]]
13
11
; CHECK-NEXT: ret i1 [[CMP]]
14
12
;
15
13
%xptr = inttoptr i64 %x to ptr
@@ -20,8 +18,7 @@ define i1 @inttoptr(i64 %x, i64 %y) {
20
18
21
19
define i1 @inttoptr_constant (i64 %x ) {
22
20
; CHECK-LABEL: @inttoptr_constant(
23
- ; CHECK-NEXT: [[XPTR:%.*]] = inttoptr i64 [[X:%.*]] to ptr
24
- ; CHECK-NEXT: [[CMP:%.*]] = icmp eq ptr [[XPTR]], inttoptr (i64 42 to ptr)
21
+ ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i64 [[X:%.*]], 42
25
22
; CHECK-NEXT: ret i1 [[CMP]]
26
23
;
27
24
%xptr = inttoptr i64 %x to ptr
@@ -31,9 +28,7 @@ define i1 @inttoptr_constant(i64 %x) {
31
28
32
29
define <2 x i1 > @inttoptr_vector (<2 x i64 > %x , <2 x i64 > %y ) {
33
30
; CHECK-LABEL: @inttoptr_vector(
34
- ; CHECK-NEXT: [[XPTR:%.*]] = inttoptr <2 x i64> [[X:%.*]] to <2 x ptr>
35
- ; CHECK-NEXT: [[YPTR:%.*]] = inttoptr <2 x i64> [[Y:%.*]] to <2 x ptr>
36
- ; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x ptr> [[XPTR]], [[YPTR]]
31
+ ; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x i64> [[X:%.*]], [[Y:%.*]]
37
32
; CHECK-NEXT: ret <2 x i1> [[CMP]]
38
33
;
39
34
%xptr = inttoptr <2 x i64 > %x to <2 x ptr >
@@ -44,8 +39,7 @@ define <2 x i1> @inttoptr_vector(<2 x i64> %x, <2 x i64> %y) {
44
39
45
40
define <2 x i1 > @inttoptr_vector_constant (<2 x i64 > %x ) {
46
41
; CHECK-LABEL: @inttoptr_vector_constant(
47
- ; CHECK-NEXT: [[XPTR:%.*]] = inttoptr <2 x i64> [[X:%.*]] to <2 x ptr>
48
- ; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x ptr> [[XPTR]], <ptr inttoptr (i64 42 to ptr), ptr inttoptr (i64 123 to ptr)>
42
+ ; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x i64> [[X:%.*]], <i64 42, i64 123>
49
43
; CHECK-NEXT: ret <2 x i1> [[CMP]]
50
44
;
51
45
%xptr = inttoptr <2 x i64 > %x to <2 x ptr >
@@ -56,10 +50,8 @@ define <2 x i1> @inttoptr_vector_constant(<2 x i64> %x) {
56
50
define i1 @inttoptr_size_mismatch (i200 %x , i9 %y ) {
57
51
; CHECK-LABEL: @inttoptr_size_mismatch(
58
52
; CHECK-NEXT: [[TMP1:%.*]] = trunc i200 [[X:%.*]] to i64
59
- ; CHECK-NEXT: [[XPTR:%.*]] = inttoptr i64 [[TMP1]] to ptr
60
53
; CHECK-NEXT: [[TMP2:%.*]] = zext i9 [[Y:%.*]] to i64
61
- ; CHECK-NEXT: [[YPTR:%.*]] = inttoptr i64 [[TMP2]] to ptr
62
- ; CHECK-NEXT: [[CMP:%.*]] = icmp eq ptr [[XPTR]], [[YPTR]]
54
+ ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i64 [[TMP1]], [[TMP2]]
63
55
; CHECK-NEXT: ret i1 [[CMP]]
64
56
;
65
57
%xptr = inttoptr i200 %x to ptr
@@ -71,8 +63,7 @@ define i1 @inttoptr_size_mismatch(i200 %x, i9 %y) {
71
63
define <2 x i1 > @inttoptr_vector_constant_size_mismatch (<2 x i200 > %x ) {
72
64
; CHECK-LABEL: @inttoptr_vector_constant_size_mismatch(
73
65
; CHECK-NEXT: [[TMP1:%.*]] = trunc <2 x i200> [[X:%.*]] to <2 x i64>
74
- ; CHECK-NEXT: [[XPTR:%.*]] = inttoptr <2 x i64> [[TMP1]] to <2 x ptr>
75
- ; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x ptr> [[XPTR]], <ptr inttoptr (i9 42 to ptr), ptr inttoptr (i9 123 to ptr)>
66
+ ; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x i64> [[TMP1]], <i64 42, i64 123>
76
67
; CHECK-NEXT: ret <2 x i1> [[CMP]]
77
68
;
78
69
%xptr = inttoptr <2 x i200 > %x to <2 x ptr >
@@ -97,7 +88,7 @@ define i1 @inttoptr_used(i64 %x, i64 %y) {
97
88
; CHECK-NEXT: [[YPTR:%.*]] = inttoptr i64 [[Y:%.*]] to ptr
98
89
; CHECK-NEXT: call void @use_ptr(ptr [[XPTR]])
99
90
; CHECK-NEXT: call void @use_ptr(ptr [[YPTR]])
100
- ; CHECK-NEXT: [[CMP:%.*]] = icmp ugt ptr [[XPTR ]], [[YPTR ]]
91
+ ; CHECK-NEXT: [[CMP:%.*]] = icmp ugt i64 [[X ]], [[Y ]]
101
92
; CHECK-NEXT: ret i1 [[CMP]]
102
93
;
103
94
%xptr = inttoptr i64 %x to ptr
0 commit comments