-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[Attributor][NFC] Improve test #129165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[Attributor][NFC] Improve test #129165
Conversation
|
@llvm/pr-subscribers-llvm-transforms Author: Johannes Doerfert (jdoerfert) ChangesFull diff: https://github.com/llvm/llvm-project/pull/129165.diff 1 Files Affected:
diff --git a/llvm/test/Transforms/Attributor/multiple-offsets-pointer-info.ll b/llvm/test/Transforms/Attributor/multiple-offsets-pointer-info.ll
index f04ac4d73340f..b2190802715cd 100644
--- a/llvm/test/Transforms/Attributor/multiple-offsets-pointer-info.ll
+++ b/llvm/test/Transforms/Attributor/multiple-offsets-pointer-info.ll
@@ -15,6 +15,9 @@ define i8 @select_offsets_simplifiable_1(i1 %cnd1, i1 %cnd2) {
; CHECK-NEXT: store i8 23, ptr [[GEP23]], align 4
; CHECK-NEXT: [[GEP29:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 29
; CHECK-NEXT: store i8 29, ptr [[GEP29]], align 4
+; CHECK-NEXT: [[GEP9:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 9
+; CHECK-NEXT: [[GEP6:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 6
+; CHECK-NEXT: store i16 6, ptr [[GEP6]], align 4
; CHECK-NEXT: [[GEP7:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 7
; CHECK-NEXT: store i8 7, ptr [[GEP7]], align 4
; CHECK-NEXT: [[GEP31:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 31
@@ -31,6 +34,12 @@ entry:
store i8 23, ptr %gep23, align 4
%gep29 = getelementptr inbounds [1024 x i8], ptr %Bytes, i64 0, i64 29
store i8 29, ptr %gep29, align 4
+ ;; This store is redundant, hence removed.
+ %gep9 = getelementptr inbounds [1024 x i8], ptr %Bytes, i64 0, i64 9
+ store i8 9, ptr %gep9, align 4
+ ;; This store is not redundant.
+ %gep6 = getelementptr inbounds [1024 x i8], ptr %Bytes, i64 0, i64 6
+ store i16 6, ptr %gep6, align 4
%gep7 = getelementptr inbounds [1024 x i8], ptr %Bytes, i64 0, i64 7
store i8 7, ptr %gep7, align 4
@@ -53,6 +62,9 @@ define i8 @select_offsets_simplifiable_2(i1 %cnd1, i1 %cnd2) {
; CHECK-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16
; CHECK-NEXT: [[GEP23:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 23
; CHECK-NEXT: store i8 23, ptr [[GEP23]], align 4
+; CHECK-NEXT: [[GEP9:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 9
+; CHECK-NEXT: [[GEP6:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 6
+; CHECK-NEXT: store i16 6, ptr [[GEP6]], align 4
; CHECK-NEXT: [[GEP29:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 29
; CHECK-NEXT: store i8 29, ptr [[GEP29]], align 4
; CHECK-NEXT: [[GEP7:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 7
@@ -70,6 +82,12 @@ entry:
%gep23 = getelementptr inbounds [1024 x i8], ptr %Bytes, i64 0, i64 23
store i8 23, ptr %gep23, align 4
+ ;; This store is redundant, hence removed.
+ %gep9 = getelementptr inbounds [1024 x i8], ptr %Bytes, i64 0, i64 9
+ store i8 9, ptr %gep9, align 4
+ ;; This store is not redundant.
+ %gep6 = getelementptr inbounds [1024 x i8], ptr %Bytes, i64 0, i64 6
+ store i16 6, ptr %gep6, align 4
%gep29 = getelementptr inbounds [1024 x i8], ptr %Bytes, i64 0, i64 29
store i8 29, ptr %gep29, align 4
%gep7 = getelementptr inbounds [1024 x i8], ptr %Bytes, i64 0, i64 7
|
| ; CHECK-NEXT: store i8 23, ptr [[GEP23]], align 4 | ||
| ; CHECK-NEXT: [[GEP29:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 29 | ||
| ; CHECK-NEXT: store i8 29, ptr [[GEP29]], align 4 | ||
| ; CHECK-NEXT: [[GEP9:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like it is not removed yet. Expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it overlaps with index 7 (due to the i16). More coverage for the case the index doesn't match but there is an overlap.
No description provided.