Skip to content

Commit d2241ad

Browse files
committed
Address comments
1 parent 7110468 commit d2241ad

File tree

10 files changed

+16
-31
lines changed

10 files changed

+16
-31
lines changed

clang/lib/Basic/Targets/RISCV.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ bool RISCVTargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
395395

396396
if (ABI == "ilp32e" && ISAInfo->hasExtension("d")) {
397397
Diags.Report(diag::err_invalid_feature_combination)
398-
<< "ILP32E must not be used with the D ISA extension";
398+
<< "ILP32E cannot be used with the D ISA extension";
399399
return false;
400400
}
401401
return true;

clang/lib/Driver/ToolChains/Arch/RISCV.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ StringRef riscv::getRISCVArch(const llvm::opt::ArgList &Args,
294294

295295
if (MABI.equals_insensitive("ilp32e"))
296296
return "rv32e";
297-
else if (MABI.starts_with_insensitive("lp64e"))
297+
else if (MABI.equals_insensitive("lp64e"))
298298
return "rv64e";
299299
else if (MABI.starts_with_insensitive("ilp32"))
300300
return "rv32imafdc";
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// RUN: not %clang_cc1 -triple riscv32 -target-feature +d -emit-llvm -target-abi ilp32e %s 2>&1 \
22
// RUN: | FileCheck -check-prefix=ILP32E-WITH-FD %s
33

4-
// ILP32E-WITH-FD: error: invalid feature combination: ILP32E must not be used with the D ISA extension
4+
// ILP32E-WITH-FD: error: invalid feature combination: ILP32E cannot be used with the D ISA extension

llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ ABI computeTargetABI(const Triple &TT, const FeatureBitset &FeatureBits,
7171
if ((TargetABI == RISCVABI::ABI::ABI_ILP32E ||
7272
(TargetABI == ABI_Unknown && IsRVE && !IsRV64)) &&
7373
FeatureBits[RISCV::FeatureStdExtD])
74-
report_fatal_error("ILP32E must not be used with the D ISA extension");
74+
report_fatal_error("ILP32E cannot be used with the D ISA extension");
7575

7676
if (TargetABI != ABI_Unknown)
7777
return TargetABI;

llvm/lib/Target/RISCV/RISCVFrameLowering.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,9 @@ void RISCVFrameLowering::emitPrologue(MachineFunction &MF,
512512
// The following calculates the correct offset knowing the number of callee
513513
// saved registers spilt by the two methods.
514514
if (int LibCallRegs = getLibCallID(MF, MFI.getCalleeSavedInfo()) + 1) {
515-
// Calculate the size of the frame managed by the libcall. The libcalls are
516-
// implemented such that the stack will always be 16 byte aligned.
515+
// Calculate the size of the frame managed by the libcall. The stack
516+
// alignment of these libcalls should be the same as how we set it in
517+
// getABIStackAlignment.
517518
unsigned LibCallFrameSize =
518519
alignTo((STI.getXLen() / 8) * LibCallRegs, getStackAlign());
519520
RVFI->setLibCallStackSize(LibCallFrameSize);

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17187,10 +17187,9 @@ static bool CC_RISCVAssign2XLen(unsigned XLen, CCState &State, CCValAssign VA1,
1718717187
// Both halves must be passed on the stack, with proper alignment.
1718817188
// TODO: To be compatible with GCC's behaviors, we force them to have 4-byte
1718917189
// alignment. This behavior may be changed when RV32E/ILP32E is ratified.
17190-
Align StackAlign =
17191-
EABI && XLen == 32
17192-
? Align(XLenInBytes)
17193-
: std::max(Align(XLenInBytes), ArgFlags1.getNonZeroOrigAlign());
17190+
Align StackAlign(XLenInBytes);
17191+
if (!EABI || XLen != 32)
17192+
StackAlign = std::max(StackAlign, ArgFlags1.getNonZeroOrigAlign());
1719417193
State.addLoc(
1719517194
CCValAssign::getMem(VA1.getValNo(), VA1.getValVT(),
1719617195
State.AllocateStack(XLenInBytes, StackAlign),

llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ BitVector RISCVRegisterInfo::getReservedRegs(const MachineFunction &MF) const {
117117

118118
// There are only 16 GPRs for RVE.
119119
if (STI.isRVE())
120-
for (size_t Reg = RISCV::X16; Reg <= RISCV::X31; Reg++)
120+
for (MCPhysReg Reg = RISCV::X16; Reg <= RISCV::X31; Reg++)
121121
markSuperRegs(Reserved, Reg);
122122

123123
// V registers for code generation. We handle them manually.

llvm/test/CodeGen/RISCV/calling-conv-ilp32e.ll

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,7 @@
1010
; RUN: -verify-machineinstrs < %s \
1111
; RUN: | FileCheck -check-prefix=ILP32E-WITHFP-SAVE-RESTORE %s
1212

13-
; As well as calling convention details, we check that ra and fp are
14-
; consistently stored to fp-4 and fp-8.
15-
16-
; Any tests that would have identical output for some combination of the ilp32*
17-
; ABIs belong in calling-conv-*-common.ll. This file contains tests that will
18-
; have different output across those ABIs. i.e. where some arguments would be
19-
; passed according to the floating point ABI, or where the stack is aligned to
20-
; a different boundary.
13+
; This file contains tests that will have differing output for the ilp32e ABIs.
2114

2215
define i32 @callee_float_in_regs(i32 %a, float %b) {
2316
; ILP32E-FPELIM-LABEL: callee_float_in_regs:

llvm/test/CodeGen/RISCV/calling-conv-lp64e.ll

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,7 @@
44
; RUN: llc -mtriple=riscv64 -target-abi lp64e -verify-machineinstrs -frame-pointer=all < %s \
55
; RUN: | FileCheck -check-prefix=RV64I-LP64E-WITHFP %s
66

7-
; As well as calling convention details, we check that ra and fp are
8-
; consistently stored to fp-8 and fp-16.
9-
10-
; Any tests that would have identical output for some combination of the lp64*
11-
; ABIs belong in calling-conv-*-common.ll. This file contains tests that will
12-
; have different output across those ABIs. i.e. where some arguments would be
13-
; passed according to the floating point ABI.
14-
15-
; TODO: softened float values can be passed anyext.
7+
; This file contains tests that will have differing output for the lp64e ABIs.
168

179
define i64 @callee_float_in_regs(i64 %a, float %b) nounwind {
1810
; RV64I-LP64E-FPELIM-LABEL: callee_float_in_regs:

llvm/test/MC/RISCV/target-abi-invalid.s

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
# RV32EF-LP64F: 64-bit ABIs are not supported for 32-bit targets (ignoring target-abi)
4343
# RV32EFD-LP64D: 64-bit ABIs are not supported for 32-bit targets (ignoring target-abi)
4444
# RV32E-LP64E: 64-bit ABIs are not supported for 32-bit targets (ignoring target-abi)
45-
# RV32EFD-LP64D: LLVM ERROR: ILP32E must not be used with the D ISA extension
45+
# RV32EFD-LP64D: LLVM ERROR: ILP32E cannot be used with the D ISA extension
4646

4747
# RUN: llvm-mc -triple=riscv32 -target-abi ilp32f < %s 2>&1 \
4848
# RUN: | FileCheck -check-prefix=RV32I-ILP32F %s
@@ -78,9 +78,9 @@
7878
# RV32E-ILP32: Only the ilp32e ABI is supported for RV32E (ignoring target-abi)
7979
# RV32EF-ILP32F: Only the ilp32e ABI is supported for RV32E (ignoring target-abi)
8080
# RV32EFD-ILP32F: Only the ilp32e ABI is supported for RV32E (ignoring target-abi)
81-
# RV32EFD-ILP32F: LLVM ERROR: ILP32E must not be used with the D ISA extension
81+
# RV32EFD-ILP32F: LLVM ERROR: ILP32E cannot be used with the D ISA extension
8282
# RV32EFD-ILP32D: Only the ilp32e ABI is supported for RV32E (ignoring target-abi)
83-
# RV32EFD-ILP32D: LLVM ERROR: ILP32E must not be used with the D ISA extension
83+
# RV32EFD-ILP32D: LLVM ERROR: ILP32E cannot be used with the D ISA extension
8484

8585
# RUN: llvm-mc -triple=riscv64 -mattr=+e -target-abi lp64 < %s 2>&1 \
8686
# RUN: | FileCheck -check-prefix=RV64EF-LP64F %s

0 commit comments

Comments
 (0)