-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[AVR] Fix for issue #163015, occasional corruption in stack passed params #164001
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
Open
carlos4242
wants to merge
4
commits into
llvm:main
Choose a base branch
from
carlos4242:fix-163082
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+81
−12
Open
Changes from 2 commits
Commits
Show all changes
4 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
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,34 @@ | ||
; RUN: llc < %s -mtriple=avr | FileCheck -v -dump-input always %s | ||
|
||
%Tstats = type <{ i8, i8 }> | ||
@ui1 = protected local_unnamed_addr global i64 zeroinitializer, align 8 | ||
@ui2 = protected local_unnamed_addr global i64 zeroinitializer, align 8 | ||
@failed = private unnamed_addr addrspace(1) constant [12 x i8] c"test failed\00" | ||
@stats = external protected global %Tstats, align 1 | ||
|
||
; CHECK-LABEL: main: | ||
define protected noundef i32 @main(i32 %0, ptr nocapture readnone %1) local_unnamed_addr addrspace(1) #0 { | ||
carlos4242 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
entry: | ||
store i64 94, ptr @ui1, align 8 | ||
store i64 53, ptr @ui2, align 8 | ||
tail call addrspace(1) void @reportFailureWithDetails(i16 ptrtoint (ptr addrspace(1) @failed to i16), i16 11, i8 2, i16 32, ptr nocapture nonnull swiftself dereferenceable(2) @stats) | ||
%11 = load i64, ptr @ui1, align 8 | ||
%12 = load i64, ptr @ui2, align 8 | ||
|
||
; COM: CHECK: call __udivdi3 | ||
%15 = udiv i64 %11, %12 | ||
|
||
; look for the buggy pattern where r30/r31 are being clobbered, corrupting the stack pointer | ||
; CHECK-NOT: std Z+{{[1-9]+}}, r30 | ||
; CHECK-NOT: std Z+{{[1-9]+}}, r31 | ||
|
||
; CHECK: call expect | ||
tail call addrspace(1) void @expect(i64 %15, i64 1, i16 ptrtoint (ptr addrspace(1) @failed to i16), i16 11, i8 2, i16 33) | ||
|
||
; CHECK: ret | ||
ret i32 0 | ||
} | ||
|
||
declare protected void @expect(i64, i64, i16, i16, i8, i16) local_unnamed_addr addrspace(1) #0 | ||
declare protected void @reportFailureWithDetails(i16, i16, i8, i16, ptr nocapture swiftself dereferenceable(2)) local_unnamed_addr addrspace(1) #0 | ||
attributes #0 = { nounwind "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" } |
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.
please use update_llc_test_checks.py to generate CHECK lines. Also, is there any reason you need
-v -dump-input always
?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.
I think it is not needed to run
update_llc_test_checks.py
, since the key check point in this test are theCHECK-NOT
lines.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 is up to reviewer to mark resolved/unresolved.
@mshockwave Do you have any more concerns for that?