@@ -394,12 +394,12 @@ define ptr @nuw_inbounds_implies_nuw_inbounds_nested_negative(ptr %p, i64 %i, i6
394394; CHECK-NEXT: [[V:%.*]] = and i64 [[V1:%.*]], -1152921488500719601
395395; CHECK-NEXT: [[IDX22:%.*]] = add i64 [[I:%.*]], [[V]]
396396; CHECK-NEXT: [[TMP0:%.*]] = getelementptr inbounds nuw i32, ptr [[P:%.*]], i64 [[IDX22]]
397- ; CHECK-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds nuw i8, ptr [[TMP0]], i64 4
397+ ; CHECK-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds nuw i8, ptr [[TMP0]], i64 -64
398398; CHECK-NEXT: ret ptr [[ARRAYIDX3]]
399399;
400400entry:
401401 %v.masked = and i64 %v , u0xf0000003c000000f
402- %idx1 = add nuw i64 %i , 1
402+ %idx1 = add nuw i64 %i , - 16
403403 %idx2 = add nuw i64 %idx1 , %v.masked
404404 %arrayidx = getelementptr inbounds nuw i32 , ptr %p , i64 %idx2
405405 ret ptr %arrayidx
@@ -462,12 +462,12 @@ define ptr @nuw_nusw_implies_nuw_nusw_nested_negative(ptr %p, i64 %i, i64 %v) {
462462; CHECK-NEXT: [[V:%.*]] = and i64 [[V1:%.*]], -1152921488500719601
463463; CHECK-NEXT: [[IDX22:%.*]] = add i64 [[I:%.*]], [[V]]
464464; CHECK-NEXT: [[TMP0:%.*]] = getelementptr nusw nuw i32, ptr [[P:%.*]], i64 [[IDX22]]
465- ; CHECK-NEXT: [[ARRAYIDX3:%.*]] = getelementptr nusw nuw i8, ptr [[TMP0]], i64 4
465+ ; CHECK-NEXT: [[ARRAYIDX3:%.*]] = getelementptr nusw nuw i8, ptr [[TMP0]], i64 -64
466466; CHECK-NEXT: ret ptr [[ARRAYIDX3]]
467467;
468468entry:
469469 %v.masked = and i64 %v , u0xf0000003c000000f
470- %idx1 = add nuw i64 %i , 1
470+ %idx1 = add nuw i64 %i , - 16
471471 %idx2 = add nuw i64 %idx1 , %v.masked
472472 %arrayidx = getelementptr nusw nuw i32 , ptr %p , i64 %idx2
473473 ret ptr %arrayidx
0 commit comments