-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[RISCV][TableGen] Correct vTtoGetLlvmTyString for RISC-V tuples. #162152
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
RISC-V tuples use "NF" not "nElem" to store the number of fields in the segment. This fixes a crash when lowering a function with tuple return. getReturnInfo in CallLowering.cpp does Type*->EVT->Type* and we were incorrectly converting EVT to Type*.
@llvm/pr-subscribers-tablegen Author: Craig Topper (topperc) ChangesRISC-V tuples use "NF" not "nElem" to store the number of fields in the segment. This fixes a crash when lowering a function with tuple return. getReturnInfo in CallLowering.cpp does Type*->EVT->Type* and we were incorrectly converting EVT to Type*. Full diff: https://github.com/llvm/llvm-project/pull/162152.diff 1 Files Affected:
diff --git a/llvm/utils/TableGen/Basic/VTEmitter.cpp b/llvm/utils/TableGen/Basic/VTEmitter.cpp
index c6b4d0b56c02b..301b27d2ebc5c 100644
--- a/llvm/utils/TableGen/Basic/VTEmitter.cpp
+++ b/llvm/utils/TableGen/Basic/VTEmitter.cpp
@@ -33,11 +33,11 @@ static void vTtoGetLlvmTyString(raw_ostream &OS, const Record *VT) {
bool IsRISCVVecTuple = VT->getValueAsBit("isRISCVVecTuple");
if (IsRISCVVecTuple) {
- unsigned NElem = VT->getValueAsInt("nElem");
+ unsigned NF = VT->getValueAsInt("NF");
unsigned Sz = VT->getValueAsInt("Size");
OS << "TargetExtType::get(Context, \"riscv.vector.tuple\", "
"ScalableVectorType::get(Type::getInt8Ty(Context), "
- << (Sz / (NElem * 8)) << "), " << NElem << ")";
+ << (Sz / (NF * 8)) << "), " << NF << ")";
return;
}
|
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.
LGTM
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/10/builds/14892 Here is the relevant piece of the build log for the reference
|
RISC-V tuples use "NF" not "nElem" to store the number of fields in the segment.
This fixes a crash when lowering a function with tuple return. getReturnInfo in CallLowering.cpp does Type*->EVT->Type* and we were incorrectly converting EVT to Type*.