-
Notifications
You must be signed in to change notification settings - Fork 14.5k
[RISCV] Guard the alternative static chain register use on ILP32E/LP64E #142715
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
Conversation
@llvm/pr-subscribers-backend-risc-v Author: Jesse Huang (jaidTw) ChangesFull diff: https://github.com/llvm/llvm-project/pull/142715.diff 1 Files Affected:
diff --git a/llvm/lib/Target/RISCV/RISCVCallingConv.cpp b/llvm/lib/Target/RISCV/RISCVCallingConv.cpp
index e0d1fb2facc87..3b609adcf8c09 100644
--- a/llvm/lib/Target/RISCV/RISCVCallingConv.cpp
+++ b/llvm/lib/Target/RISCV/RISCVCallingConv.cpp
@@ -338,6 +338,10 @@ bool llvm::CC_RISCV(unsigned ValNo, MVT ValVT, MVT LocVT,
bool HasCFBranch =
Subtarget.hasStdExtZicfilp() &&
MF.getFunction().getParent()->getModuleFlag("cf-protection-branch");
+ if (HasCFBranch && (Subtarget.isRV32() && Subtarget.hasStdExtE()))
+ reportFatalUsageError(
+ "Alternative static chain register is not supported on RV32E");
+
// Normal: t2, Branch control flow protection: t3
const auto StaticChainReg = HasCFBranch ? RISCV::X28 : RISCV::X7;
|
Co-authored-by: Kito Cheng <[email protected]>
✅ With the latest revision this PR passed the C/C++ code formatter. |
ping |
Can we have a test for this? You use the |
Co-authored-by: Sam Elliott <[email protected]>
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/157/builds/30527 Here is the relevant piece of the build log for the reference
|
…4E (llvm#142715) Asserts the use of t3(x28) as the static chain register when branch control flow protection is enabled with ILP32E/LP64E, because such register is not present within the ABI.
…4E (llvm#142715) Asserts the use of t3(x28) as the static chain register when branch control flow protection is enabled with ILP32E/LP64E, because such register is not present within the ABI.
No description provided.