[llvm] [RISCV] Add Stackmap/Statepoint/Patchpoint support with targets (PR #77337)

Sacha Coppey via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 2 04:42:39 PDT 2024


================
@@ -1523,9 +1523,12 @@ unsigned RISCVInstrInfo::getInstSizeInBytes(const MachineInstr &MI) const {
   case TargetOpcode::PATCHPOINT:
     // The size of the patchpoint intrinsic is the number of bytes requested
     return PatchPointOpers(&MI).getNumPatchBytes();
-  case TargetOpcode::STATEPOINT:
+  case TargetOpcode::STATEPOINT: {
     // The size of the statepoint intrinsic is the number of bytes requested
-    return StatepointOpers(&MI).getNumPatchBytes();
+    unsigned NumBytes = StatepointOpers(&MI).getNumPatchBytes();
+    // A statepoint is at least a PseudoCALL
----------------
Zeavee wrote:

This comment is slightly off, so I will replace it with `// No patch bytes means a PseudoCall is emitted`. Otherwise, using `getNumPatchBytes` is always correct as `NOPS` are emitted to match the requested patch size.

https://github.com/llvm/llvm-project/pull/77337


More information about the llvm-commits mailing list