Details
- Reviewers
asb
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
Could you please add a test case or test cases that highlight the behavioural change?
Hi @asb,
I think this patch only addresses the TODO and has no behavioral change.
Test case is already covered under llvm/test/MC/RISCV/target-abi-invalid.s.
I suggest renaming the title to "[RISCV][NFC] Move ilp32e/rv32e checks to AsmParser and TargetLowering", to make it clearer that this is just a refactoring.
Test case is already covered under llvm/test/MC/RISCV/target-abi-invalid.s.
The new error message in RISCVISelLowering.cpp isn't yet covered by tests but that line currently isn't reachable due to the report_fatal_error in line 52. It's not ideal that this can't have test coverage. @asb thoughts?
I was assuming that it would be a bad idea to remove the report_fatal_error because code generation would still occur (despite the error message) and possibly crash in unpleasant ways but maybe that's not significantly different from the other error conditions above where that also happens.
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
72 ↗ | (On Diff #394798) | This is clearly wrong, just copy-pasted from the RVI cases |
Delete redundant code.
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
72 ↗ | (On Diff #394798) | Yes you are right. I think the code I added here is redundant. Just deleted. |
llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.cpp | ||
---|---|---|
55 | This code path can be exercised through a test like those in test/CodeGen/RISCV/target-abi-invalid.ll (e.g. targeting riscv32 -mattr=+e and without setting the ABI to ilp32e). With ilp32e ABI support not yet landed but some support for command-line options etc, the current state of affairs is a bit weird. But I think it would be better to add a test case to taret-abi-invalid.ll rather than removing this logic. |
llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.cpp | ||
---|---|---|
55 | Yeah, I have added a test for this. We would have to wait for ilp32e to land before this patch. |
This code path can be exercised through a test like those in test/CodeGen/RISCV/target-abi-invalid.ll (e.g. targeting riscv32 -mattr=+e and without setting the ABI to ilp32e). With ilp32e ABI support not yet landed but some support for command-line options etc, the current state of affairs is a bit weird. But I think it would be better to add a test case to taret-abi-invalid.ll rather than removing this logic.