[llvm] [RISCV] Implement Statepoint and Patchpoint lowering to call instructions (PR #77337)
Pengcheng Wang via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 9 03:16:50 PDT 2024
================
@@ -152,8 +153,40 @@ void RISCVAsmPrinter::LowerPATCHPOINT(MCStreamer &OutStreamer, StackMaps &SM,
PatchPointOpers Opers(&MI);
+ const MachineOperand &CalleeMO = Opers.getCallTarget();
unsigned EncodedBytes = 0;
+ if (CalleeMO.isImm()) {
+ uint64_t CallTarget = CalleeMO.getImm();
+ if (CallTarget) {
+ assert((CallTarget & 0xFFFF'FFFF'FFFF) == CallTarget &&
+ "High 16 bits of call target should be zero.");
+ // Materialize the jump address:
+ SmallVector<MCInst, 8> Seq;
+ RISCVMatInt::generateMCInstSeq(CallTarget, *STI, RISCV::X1, Seq);
+ for (MCInst &Inst : Seq) {
+ MCInst CInst;
+ bool compressed = RISCVRVC::compress(CInst, Inst, *STI);
----------------
wangpc-pp wrote:
compressed -> Compressed
https://github.com/llvm/llvm-project/pull/77337
More information about the llvm-commits
mailing list