-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[RISCV][MRI] Account for fixed registers when determining callee saved regs #115756
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
michaelmaitland
merged 8 commits into
llvm:main
from
michaelmaitland:riscv-fixed-regalloc-spill
Dec 6, 2024
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
55641bb
[RISCV][RegAlloc] Pre-commit test case
michaelmaitland 3c661fe
[MRI][RISCV] Account for fixed registers when determining callee save…
michaelmaitland 958aeb3
fixup! fix test checks RUN string
michaelmaitland dc3a58b
fixup spill next register
michaelmaitland 5af3161
fixup! add m68k test
michaelmaitland 59dc0b7
fixup! use callee saved register
michaelmaitland 857380f
fixup! fremove M68k from patch
michaelmaitland b6f1191
fixup! add nounwind to test
michaelmaitland 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
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,12 @@ | ||
| ; RUN: not --crash llc -mtriple=m68k -mattr=+reserve-a0 < %s 2>&1 | FileCheck %s | ||
|
|
||
| ; CHECK: Named registers not implemented for this target | ||
| define noundef i32 @foo() { | ||
| tail call void @llvm.write_register.i32(metadata !0, i32 321) | ||
| ret i32 0 | ||
| } | ||
|
|
||
| declare void @llvm.write_register.i32(metadata, i32) | ||
|
|
||
| !llvm.named.register.a0 = !{!0} | ||
| !0 = !{!"a0"} | ||
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,39 @@ | ||
| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 | ||
| ; RUN: llc -mtriple=riscv64 -mattr=+reserve-x24 < %s | FileCheck %s | ||
|
|
||
| define noundef signext i32 @foo() { | ||
| ; CHECK-LABEL: foo: | ||
| ; CHECK: # %bb.0: | ||
| ; CHECK-NEXT: li s8, 321 | ||
| ; CHECK-NEXT: li a0, 0 | ||
| ; CHECK-NEXT: ret | ||
| tail call void @llvm.write_register.i64(metadata !0, i64 321) | ||
| ret i32 0 | ||
| } | ||
|
|
||
| declare void @llvm.write_register.i64(metadata, i64) | ||
|
|
||
| define noundef signext i32 @bar() { | ||
|
||
| ; CHECK-LABEL: bar: | ||
| ; CHECK: # %bb.0: | ||
| ; CHECK-NEXT: addi sp, sp, -16 | ||
| ; CHECK-NEXT: .cfi_def_cfa_offset 16 | ||
| ; CHECK-NEXT: sd s9, 8(sp) # 8-byte Folded Spill | ||
| ; CHECK-NEXT: .cfi_offset s9, -8 | ||
| ; CHECK-NEXT: #APP | ||
| ; CHECK-NEXT: #NO_APP | ||
| ; CHECK-NEXT: li s8, 321 | ||
| ; CHECK-NEXT: li a0, 0 | ||
| ; CHECK-NEXT: ld s9, 8(sp) # 8-byte Folded Reload | ||
| ; CHECK-NEXT: .cfi_restore s9 | ||
| ; CHECK-NEXT: addi sp, sp, 16 | ||
| ; CHECK-NEXT: .cfi_def_cfa_offset 0 | ||
| ; CHECK-NEXT: ret | ||
| tail call void asm sideeffect "", "~{x25}"() #3 | ||
| tail call void @llvm.write_register.i64(metadata !0, i64 321) | ||
| ret i32 0 | ||
| } | ||
|
|
||
| !llvm.named.register.x24 = !{!0} | ||
| !0 = !{!"x24"} | ||
|
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.