-
Notifications
You must be signed in to change notification settings - Fork 1
[CHERI] Fix Bounded Mem/Var Args layout on stack #12
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
veselypeta
wants to merge
5
commits into
codasip-cheri-riscv
Choose a base branch
from
petr/fix-bounded-var-mem-args
base: codasip-cheri-riscv
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.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b46607b
[CHERI] Fix Bounded Mem/Var Args layout on stack
veselypeta 2e12ff6
[CHERI] Align aggregate types upto stack slot
veselypeta ca79bd0
[CHERI] use ct6 as var/mem arg register
veselypeta f355c03
[CHERI] Disable var/mem args for fastcc
veselypeta 4553bd7
[CHERI] Convert test to opaque pointers
veselypeta 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
70 changes: 70 additions & 0 deletions
70
llvm/test/CodeGen/RISCV/cheri/bakewell/cheri-bound-varargs-aggregates.ll
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,70 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2 | ||
; RUN: llc -mtriple riscv64 -mattr=+zcheripurecap,+zcherihybrid,+cap-mode,+cheri-bounded-vararg,+cheri-bounded-memarg-callee,+cheri-bounded-memarg-caller -target-abi l64pc128d %s -o - | FileCheck %s | ||
|
||
define dso_local i32 @g() addrspace(200) { | ||
; CHECK-LABEL: g: | ||
; CHECK: # %bb.0: # %entry | ||
; CHECK-NEXT: caddi csp, csp, -48 | ||
; CHECK-NEXT: .cfi_def_cfa_offset 48 | ||
; CHECK-NEXT: sc cra, 32(csp) # 16-byte Folded Spill | ||
; CHECK-NEXT: .cfi_offset ra, -16 | ||
; CHECK-NEXT: li a0, 200 | ||
; CHECK-NEXT: sd a0, 24(csp) | ||
; CHECK-NEXT: li a0, 100 | ||
; CHECK-NEXT: sd a0, 16(csp) | ||
; CHECK-NEXT: li a0, 8 | ||
; CHECK-NEXT: li a1, 32 | ||
; CHECK-NEXT: scbndsr ct6, csp, a1 | ||
; CHECK-NEXT: li a1, 1 | ||
; CHECK-NEXT: li a2, 2 | ||
; CHECK-NEXT: li a3, 3 | ||
; CHECK-NEXT: li a4, 4 | ||
; CHECK-NEXT: li a5, 5 | ||
; CHECK-NEXT: li a6, 6 | ||
; CHECK-NEXT: li a7, 7 | ||
; CHECK-NEXT: sd a0, 0(csp) | ||
; CHECK-NEXT: li a0, 0 | ||
; CHECK-NEXT: call f | ||
; CHECK-NEXT: lc cra, 32(csp) # 16-byte Folded Reload | ||
; CHECK-NEXT: caddi csp, csp, 48 | ||
; CHECK-NEXT: ret | ||
entry: | ||
%call = tail call signext i32 (i32, i32, i32, i32, i32, i32, i32, i32, i32, ...) @f(i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, [2 x i64] [i64 100, i64 200]) | ||
ret i32 %call | ||
} | ||
|
||
declare i32 @f(i32, i32, i32, i32, i32, i32, i32, i32, i32, ...) addrspace(200) | ||
|
||
define dso_local i128 @foo() addrspace(200) { | ||
; CHECK-LABEL: foo: | ||
; CHECK: # %bb.0: # %entry | ||
; CHECK-NEXT: caddi csp, csp, -48 | ||
; CHECK-NEXT: .cfi_def_cfa_offset 48 | ||
; CHECK-NEXT: sc cra, 32(csp) # 16-byte Folded Spill | ||
; CHECK-NEXT: .cfi_offset ra, -16 | ||
; CHECK-NEXT: sd zero, 24(csp) | ||
; CHECK-NEXT: li a0, 789 | ||
; CHECK-NEXT: sd a0, 16(csp) | ||
; CHECK-NEXT: sd zero, 8(csp) | ||
; CHECK-NEXT: li a1, 456 | ||
; CHECK-NEXT: li a0, 32 | ||
; CHECK-NEXT: scbndsr ct6, csp, a0 | ||
; CHECK-NEXT: caddi ca0, cnull, 1 | ||
; CHECK-NEXT: li a5, 123 | ||
; CHECK-NEXT: sd a1, 0(csp) | ||
; CHECK-NEXT: li a1, 0 | ||
; CHECK-NEXT: li a2, 0 | ||
; CHECK-NEXT: li a3, 0 | ||
; CHECK-NEXT: li a4, 0 | ||
; CHECK-NEXT: li a6, 0 | ||
; CHECK-NEXT: call bar | ||
; CHECK-NEXT: lc cra, 32(csp) # 16-byte Folded Reload | ||
; CHECK-NEXT: caddi csp, csp, 48 | ||
; CHECK-NEXT: ret | ||
entry: | ||
%call = call i128 (ptr addrspace(200), i128, i128, i128, ...) @bar(ptr addrspace(200) getelementptr (i8, ptr addrspace(200) null, i64 1), i128 0, i128 0, i128 123, i128 456, i128 789) | ||
ret i128 %call | ||
} | ||
|
||
declare i128 @bar(ptr addrspace(200), i128, i128, i128, ...) addrspace(200) | ||
|
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.