[PATCH] D115853: [RISCV][ABI] Have ABI checks for ilp32e under AsmParser and TargetLowering
Yueh-Ting Chen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 16 02:45:47 PST 2021
eopXD updated this revision to Diff 394798.
eopXD added a comment.
Update code.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D115853/new/
https://reviews.llvm.org/D115853
Files:
llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.cpp
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
Index: llvm/lib/Target/RISCV/RISCVISelLowering.cpp
===================================================================
--- llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -66,6 +66,10 @@
"doesn't support the D instruction set extension (ignoring "
"target-abi)\n";
ABI = Subtarget.is64Bit() ? RISCVABI::ABI_LP64 : RISCVABI::ABI_ILP32;
+ } else if (Subtarget.isRV32E() && ABI != RISCVABI::ABI_ILP32E) {
+ errs() << "Only the ilp32e ABI is supported for RV32E (ignoring "
+ "target-abi)\n";
+ ABI = Subtarget.is64Bit() ? RISCVABI::ABI_LP64 : RISCVABI::ABI_ILP32;
}
switch (ABI) {
Index: llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.cpp
===================================================================
--- llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.cpp
+++ llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.cpp
@@ -51,11 +51,6 @@
errs() << "64-bit ABIs are not supported for 32-bit targets (ignoring "
"target-abi)\n";
TargetABI = ABI_Unknown;
- } else if (IsRV32E && TargetABI != ABI_ILP32E && TargetABI != ABI_Unknown) {
- // TODO: move this checking to RISCVTargetLowering and RISCVAsmParser
- errs()
- << "Only the ilp32e ABI is supported for RV32E (ignoring target-abi)\n";
- TargetABI = ABI_Unknown;
}
if (TargetABI != ABI_Unknown)
Index: llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
===================================================================
--- llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
+++ llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
@@ -252,6 +252,10 @@
errs() << "Hard-float 'd' ABI can't be used for a target that "
"doesn't support the D instruction set extension (ignoring "
"target-abi)\n";
+ } else if (!ABIName.endswith("e") &&
+ getSTI().getFeatureBits()[RISCV::FeatureRV32E]) {
+ errs() << "Only the ilp32e ABI is supported for RV32E (ignoring "
+ "target-abi)\n";
}
const MCObjectFileInfo *MOFI = Parser.getContext().getObjectFileInfo();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115853.394798.patch
Type: text/x-patch
Size: 2148 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211216/2b4d52f5/attachment.bin>
More information about the llvm-commits
mailing list