@@ -76,25 +76,6 @@ entry:
7676 ret ptr %gep
7777}
7878
79- ; Test with non-disjoint bits: Ensure the transformation does not occur
80- define ptr @test_with_non_disjoint_bits (i64 %val , ptr %ptr ) {
81- ; CHECK-LABEL: define ptr @test_with_non_disjoint_bits(
82- ; CHECK-SAME: i64 [[VAL:%.*]], ptr [[PTR:%.*]]) {
83- ; CHECK-NEXT: [[ENTRY:.*:]]
84- ; CHECK-NEXT: [[AND:%.*]] = and i64 [[VAL]], 31
85- ; CHECK-NEXT: [[XOR1:%.*]] = xor i64 [[AND]], 4
86- ; CHECK-NEXT: [[XOR21:%.*]] = or disjoint i64 [[XOR1]], 16
87- ; CHECK-NEXT: [[GEP:%.*]] = getelementptr i8, ptr [[PTR]], i64 [[XOR21]]
88- ; CHECK-NEXT: ret ptr [[GEP]]
89- ;
90- entry:
91- %and = and i64 %val , 31 ; val can have bits 0-4 set
92- %xor1 = xor i64 %and , 4 ; Flips bit 2
93- %xor2 = xor i64 %and , 20 ; Flips bits 2 and 4, should NOT replace since bit 4 overlaps with possible val bits
94- %gep = getelementptr i8 , ptr %ptr , i64 %xor2
95- ret ptr %gep
96- }
97-
9879; Test with multiple xor operations in sequence
9980define ptr @test_multiple_xors (ptr %ptr ) {
10081; CHECK-LABEL: define ptr @test_multiple_xors(
@@ -144,8 +125,8 @@ entry:
144125
145126
146127; Test with multiple xor operations in sequence
147- define ptr @aatest_multiple_xors (ptr %ptr ) {
148- ; CHECK-LABEL: define ptr @aatest_multiple_xors (
128+ define ptr @test_negative_offset (ptr %ptr ) {
129+ ; CHECK-LABEL: define ptr @test_negative_offset (
149130; CHECK-SAME: ptr [[PTR:%.*]]) {
150131; CHECK-NEXT: [[ENTRY:.*:]]
151132; CHECK-NEXT: [[BASE:%.*]] = add i64 2, 0
0 commit comments