This change allows checking for ISA extensions in print methods.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Looking at the comment for PassSubtarget in Target.td it seems like this is something we should enable. Is there an observable bug in the current backend that can be fixed thanks to this?
@niosHD suggested there might be an observable issue with the instalias for floating point CSRs
Ignoring the predicates currently leads to the problem that aliases get printed although the corresponding extension is not enabled.
For example, the following snippet disassembles csrrs to frcsr although the f extension is not enabled. Assembling on the other hand works as expected, i.e., frcsr is rejected when the f extension is disabled.
% cat csrrs.S csrrs t0, 3, zero mwerner@t440smw ~/tmp [2018-01-04 18:51:33] % llvm-mc -filetype=obj -triple riscv64 < csrrs.S | llvm-objdump -d - <stdin>: file format ELF64-riscv Disassembly of section .text: .text: 0: f3 22 30 00 frcsr t0
It would be great if we can fix this flaw by enabling PassSubtarget.
Hi Mario, thanks for the pointing out this alias test case.
I confirm that the patch fixes this case.
llvm-mc -triple riscv64 -filetype=obj < csrrs.S |llvm-objdump -d -
<stdin>: file format ELF64-riscv
Disassembly of section .text:
.text:
0: f3 22 30 00 csrr t0, 3
Great, thank you Ana for confirming that this patch fixes the problem.
Do you plan to add the test to the test suite or should I submit a patch after this one has landed?