-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[DA] add testcase #116631
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
Merged
Merged
[DA] add testcase #116631
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 5 | ||
; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \ | ||
; RUN: | FileCheck %s | ||
|
||
; DependenceAnalysis used to run into a heap buffer overflow on this testcase. | ||
; See https://github.com/llvm/llvm-project/issues/31196 for details. | ||
|
||
define void @barney(ptr nocapture %arg, i32 %arg1) { | ||
; CHECK-LABEL: 'barney' | ||
; CHECK-NEXT: Src: store i32 7, ptr %getelementptr, align 4 --> Dst: store i32 7, ptr %getelementptr, align 4 | ||
; CHECK-NEXT: da analyze - output [* * * *]! | ||
; | ||
bb: | ||
%icmp = icmp sgt i32 %arg1, 0 | ||
br i1 %icmp, label %bb2, label %bb31 | ||
|
||
bb2: ; preds = %bb28, %bb | ||
%phi = phi i32 [ %add29, %bb28 ], [ 0, %bb ] | ||
br label %bb3 | ||
|
||
bb3: ; preds = %bb25, %bb2 | ||
%phi4 = phi i32 [ %add26, %bb25 ], [ 0, %bb2 ] | ||
br label %bb5 | ||
|
||
bb5: ; preds = %bb22, %bb3 | ||
%phi6 = phi i32 [ -1, %bb3 ], [ %add23, %bb22 ] | ||
%add7 = add nsw i32 %phi6, %phi4 | ||
br label %bb8 | ||
|
||
bb8: ; preds = %bb19, %bb5 | ||
%phi9 = phi i32 [ -1, %bb5 ], [ %add20, %bb19 ] | ||
%add10 = add nsw i32 %phi9, %phi | ||
br label %bb11 | ||
|
||
bb11: ; preds = %bb11, %bb8 | ||
%phi12 = phi i32 [ %add7, %bb8 ], [ %add14, %bb11 ] | ||
%icmp13 = icmp slt i32 %phi12, 0 | ||
%add14 = add nsw i32 %phi12, %arg1 | ||
br i1 %icmp13, label %bb11, label %bb15 | ||
|
||
bb15: ; preds = %bb15, %bb11 | ||
%phi16 = phi i32 [ %add18, %bb15 ], [ %add10, %bb11 ] | ||
%icmp17 = icmp slt i32 %phi16, 0 | ||
%add18 = add nsw i32 %phi16, %arg1 | ||
br i1 %icmp17, label %bb15, label %bb19 | ||
|
||
bb19: ; preds = %bb15 | ||
%mul = mul nsw i32 %phi16, %arg1 | ||
%add = add nsw i32 %mul, %phi12 | ||
%sext = sext i32 %add to i64 | ||
%getelementptr = getelementptr inbounds i32, ptr %arg, i64 %sext | ||
store i32 7, ptr %getelementptr, align 4 | ||
%add20 = add nsw i32 %phi9, 1 | ||
%icmp21 = icmp eq i32 %add20, 2 | ||
br i1 %icmp21, label %bb22, label %bb8 | ||
|
||
bb22: ; preds = %bb19 | ||
%add23 = add nsw i32 %phi6, 1 | ||
%icmp24 = icmp eq i32 %add23, 2 | ||
br i1 %icmp24, label %bb25, label %bb5 | ||
|
||
bb25: ; preds = %bb22 | ||
%add26 = add nuw nsw i32 %phi4, 1 | ||
%icmp27 = icmp eq i32 %add26, %arg1 | ||
br i1 %icmp27, label %bb28, label %bb3 | ||
|
||
bb28: ; preds = %bb25 | ||
%add29 = add nuw nsw i32 %phi, 1 | ||
%icmp30 = icmp eq i32 %add29, %arg1 | ||
br i1 %icmp30, label %bb31, label %bb2 | ||
|
||
bb31: ; preds = %bb28, %bb | ||
ret void | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Would be great to have more descriptive names, so it is easier to read the test and see the loop structure (e.g.
loop.1.header
for loop headers,%iv
for inductions and so onThere 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.
I just used
opt -passes=metarenamer -S a.ll
to prepare the testcase with more standard names. I guess we could improve the metarenamer to produce more readable BB and var names.