@@ -45,10 +45,8 @@ define i1 @inttoptr_add_ptrtoint_used_by_single_icmp(ptr %src, ptr %p2) {
4545
4646define i1 @inttoptr_add_ptrtoint_used_by_single_icmp_operands_swapped (ptr %src , ptr %p2 ) {
4747; CHECK-LABEL: @inttoptr_add_ptrtoint_used_by_single_icmp_operands_swapped(
48- ; CHECK-NEXT: [[I:%.*]] = ptrtoint ptr [[SRC:%.*]] to i64
49- ; CHECK-NEXT: [[A:%.*]] = add i64 [[I]], 10
50- ; CHECK-NEXT: [[P:%.*]] = inttoptr i64 [[A]] to ptr
51- ; CHECK-NEXT: [[C:%.*]] = icmp eq ptr [[P2:%.*]], [[P]]
48+ ; CHECK-NEXT: [[P2:%.*]] = getelementptr i8, ptr [[SRC:%.*]], i64 10
49+ ; CHECK-NEXT: [[C:%.*]] = icmp eq ptr [[P2]], [[P:%.*]]
5250; CHECK-NEXT: ret i1 [[C]]
5351;
5452 %i = ptrtoint ptr %src to i64
@@ -60,10 +58,8 @@ define i1 @inttoptr_add_ptrtoint_used_by_single_icmp_operands_swapped(ptr %src,
6058
6159define i1 @inttoptr_add_ptrtoint_used_by_single_icmp_constant_offset (ptr %src , i64 %off , ptr %p2 ) {
6260; CHECK-LABEL: @inttoptr_add_ptrtoint_used_by_single_icmp_constant_offset(
63- ; CHECK-NEXT: [[I:%.*]] = ptrtoint ptr [[SRC:%.*]] to i64
64- ; CHECK-NEXT: [[A:%.*]] = add i64 [[OFF:%.*]], [[I]]
65- ; CHECK-NEXT: [[P:%.*]] = inttoptr i64 [[A]] to ptr
66- ; CHECK-NEXT: [[C:%.*]] = icmp eq ptr [[P2:%.*]], [[P]]
61+ ; CHECK-NEXT: [[P2:%.*]] = getelementptr i8, ptr [[SRC:%.*]], i64 [[OFF:%.*]]
62+ ; CHECK-NEXT: [[C:%.*]] = icmp eq ptr [[P2]], [[P:%.*]]
6763; CHECK-NEXT: ret i1 [[C]]
6864;
6965 %i = ptrtoint ptr %src to i64
@@ -75,10 +71,8 @@ define i1 @inttoptr_add_ptrtoint_used_by_single_icmp_constant_offset(ptr %src, i
7571
7672define i1 @inttoptr_add_ptrtoint_used_by_single_icmp_constant_offset_operands_swapped (ptr %src , i64 %off , ptr %p2 ) {
7773; CHECK-LABEL: @inttoptr_add_ptrtoint_used_by_single_icmp_constant_offset_operands_swapped(
78- ; CHECK-NEXT: [[I:%.*]] = ptrtoint ptr [[SRC:%.*]] to i64
79- ; CHECK-NEXT: [[A:%.*]] = add i64 [[OFF:%.*]], [[I]]
80- ; CHECK-NEXT: [[P:%.*]] = inttoptr i64 [[A]] to ptr
81- ; CHECK-NEXT: [[C:%.*]] = icmp eq ptr [[P2:%.*]], [[P]]
74+ ; CHECK-NEXT: [[P2:%.*]] = getelementptr i8, ptr [[SRC:%.*]], i64 [[OFF:%.*]]
75+ ; CHECK-NEXT: [[C:%.*]] = icmp eq ptr [[P2]], [[P:%.*]]
8276; CHECK-NEXT: ret i1 [[C]]
8377;
8478 %i = ptrtoint ptr %src to i64
0 commit comments