Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions llvm/test/Transforms/Attributor/multiple-offsets-pointer-info.ll
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

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?

Copy link
Member Author

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.

; 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
Expand All @@ -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

Expand All @@ -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
Expand All @@ -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
Expand Down