-
Notifications
You must be signed in to change notification settings - Fork 30
[AIE2P] Add alternative calling convention for library calls #664
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
base: aie-public
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,9 +22,34 @@ using namespace llvm; | |
|
|
||
| #define DEBUG_TYPE "aie-lower" | ||
|
|
||
| cl::opt<bool> | ||
| VecCCLibcalls("aie-libcalls-preserve-vectors", cl::init(true), cl::Hidden, | ||
| cl::desc("Assume all vector registers are callee-saved by " | ||
| "builtin library functions.")); | ||
|
|
||
| AIE2PTargetLowering::AIE2PTargetLowering(const TargetMachine &TM, | ||
| const AIEBaseSubtarget &STI) | ||
| : AIEBaseTargetLowering(TM, STI) { | ||
|
|
||
| if (VecCCLibcalls) { | ||
| setLibcallCallingConv(RTLIB::SINTTOFP_I32_F32, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: perhaps make a data-driven routine running on an array of function ids? |
||
| CallingConv::AIE_PreserveAll_Vec); | ||
| setLibcallCallingConv(RTLIB::SINTTOFP_I32_F64, | ||
| CallingConv::AIE_PreserveAll_Vec); | ||
| setLibcallCallingConv(RTLIB::SINTTOFP_I64_F32, | ||
| CallingConv::AIE_PreserveAll_Vec); | ||
| setLibcallCallingConv(RTLIB::SINTTOFP_I64_F64, | ||
| CallingConv::AIE_PreserveAll_Vec); | ||
| setLibcallCallingConv(RTLIB::SDIV_I32, CallingConv::AIE_PreserveAll_Vec); | ||
| setLibcallCallingConv(RTLIB::SDIV_I64, CallingConv::AIE_PreserveAll_Vec); | ||
| setLibcallCallingConv(RTLIB::UDIV_I32, CallingConv::AIE_PreserveAll_Vec); | ||
| setLibcallCallingConv(RTLIB::UDIV_I64, CallingConv::AIE_PreserveAll_Vec); | ||
| setLibcallCallingConv(RTLIB::SREM_I32, CallingConv::AIE_PreserveAll_Vec); | ||
| setLibcallCallingConv(RTLIB::SREM_I64, CallingConv::AIE_PreserveAll_Vec); | ||
| setLibcallCallingConv(RTLIB::UREM_I32, CallingConv::AIE_PreserveAll_Vec); | ||
| setLibcallCallingConv(RTLIB::UREM_I64, CallingConv::AIE_PreserveAll_Vec); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see some other libcalls in the LegalizerHelper. Are these only the verified ones?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, these are only the ones I verified. Others could likely be included as well, but I wanted to keep this limited for now |
||
| } | ||
|
|
||
| const TargetRegisterInfo *TRI = Subtarget.getRegisterInfo(); | ||
|
|
||
| // We already define in .td which types are legal for each register class. | ||
|
|
||
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.
nit: can we write this as an extension to CSR_AIE2P?
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.
e.g. factoring using a named common set?