[PATCH] D135960: [RISCV] Allow LI with symbol difference as constant
Jessica Clarke via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 7 11:34:32 PST 2023
jrtc27 added inline comments.
================
Comment at: llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp:2729
// Just convert to an addi. This allows compatibility with gas.
- emitToStreamer(Out, MCInstBuilder(RISCV::ADDI)
- .addReg(Reg)
- .addReg(RISCV::X0)
- .addExpr(Op1.getExpr()));
+ MCInst Addi = MCInstBuilder(RISCV::ADDI)
+ .addReg(Reg)
----------------
reames wrote:
> reames wrote:
> > Please separate this change as it's own diff so I can review it separately.
> It also looks like we have the same problem in emitAuipcInstPair used for a bunch of the other cases.
This would probably be nicer if MCInstBuilder could take an SMLoc in its constructor and/or had a setLoc method. There are surely many cases of backends throwing this away as a result... though this is AsmParser so debug info is barely a thing.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D135960/new/
https://reviews.llvm.org/D135960
More information about the llvm-commits
mailing list