-
Notifications
You must be signed in to change notification settings - Fork 41
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
[CHERI][InstCombine] Fix 8-byte capability memcpy inlining #736
Conversation
; CHECK-NEXT: store ptr addrspace(200) [[TMP0]], ptr addrspace(200) [[D:%.*]], align 8 | ||
; CHECK-NEXT: ret ptr addrspace(200) [[D]] | ||
; | ||
entry: |
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.
Don't need to name the blocks
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.
Should be fixed now?
; CHECK-NEXT: ret ptr addrspace(200) [[D]] | ||
; | ||
entry: | ||
; memcpy can be transformed to capability load/store |
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.
Use ;; for non-FileCheck comments, and put at the top of the test function rather than buried inside it
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.
Should be fixed now?
ret ptr addrspace(200) %d | ||
} | ||
|
||
; Function Attrs: argmemonly mustprogress nocallback nofree nounwind willreturn |
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.
Useless comment from original IR dump
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.
Should be fixed now?
} | ||
|
||
; Function Attrs: argmemonly mustprogress nocallback nofree nounwind willreturn | ||
declare void @llvm.memcpy.p200.p200.i32(ptr addrspace(200) noalias nocapture writeonly, ptr addrspace(200) noalias nocapture readonly, i32, i1 immarg) addrspace(200) #1 |
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.
Even all these attributes should be removable, LLVM will add them automatically
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.
Should be fixed now?
ret ptr addrspace(200) %d | ||
} | ||
|
||
define ptr addrspace(200) @test_memcpy8_nocap_align_unkown(ptr addrspace(200) noundef %d, ptr addrspace(200) noundef %s) local_unnamed_addr addrspace(200) { |
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.
Typo ("unkown")
6c428fe
to
a996ce3
Compare
Your second commit is authored by Stephen Clarke [email protected] but the first by Stephen Clarke [email protected] (and only the former seems associated with your GitHub account?). Otherwise looks good now thanks. |
a996ce3
to
735c067
Compare
The motivating case for this change is https://cheri-compiler-explorer.cl.cam.ac.uk/z/ore1Ej - the compiler is copying a capability using non-cap load and store. The issue is for copying 8-byte capabilities only, so won't affect targets with 16-byte capabilities e.g. rv64.