llvm-project
7f28e8ce - [RISCV] Implement RISCVInstrInfo::isAddImmediate (#72356)

Commit
1 year ago
[RISCV] Implement RISCVInstrInfo::isAddImmediate (#72356) This hook is called by the target-independent implementation of TargetInstrInfo::describeLoadedValue. I've opted to test it via a C++ unit test, which although fiddly to set up seems the right way to test a function with such clear intended semantics (rather than testing the impact indirectly). isAddImmediate will never recognise ADDIW as an add immediate which I _think_ is conservatively correct, as the caller may not understand its semantics vs ADDI. Note that although the doc comment for isAddImmediate specifies its behaviour solely in terms of physical registers, none of the current in-tree implementations (including this one) bail out on virtual registers (see #72357).
Author
asb asb
Parents
Loading