[PATCH] D129268: Legalise patchpoint arguments.

Edd Barrett via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 7 03:15:02 PDT 2022


vext01 created this revision.
vext01 added a reviewer: arsenm.
Herald added subscribers: jsji, pengfei, hiraditya.
Herald added a project: All.
vext01 requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

This is similar to D125680 <https://reviews.llvm.org/D125680>, but for `llvm.experimental.patchpoint` (instead of `llvm.experimental.stackmap`).

Some test outputs changed, e.g. passing `i16 65535` as a live caused:

  -; CHECK-NEXT:   .long   -1
  +; CHECK-NEXT:   .long   65535

I think this is OK. I think the runtime is expected to know the true size of the constant, and the higher order bits are undefined. Under this assumption, `-1` and `65535` are equivalent for a `i16`.

[The runtime certainly can't rely on the `size` field in the stackmap record, which for this constant `i16` is reporting as 8 bytes long. This is particularly confusing in this instance, as the small constant field can only hold 4-bytes!]


https://reviews.llvm.org/D129268

Files:
  llvm/include/llvm/CodeGen/ISDOpcodes.h
  llvm/include/llvm/CodeGen/SelectionDAGISel.h
  llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
  llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
  llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
  llvm/test/CodeGen/AArch64/stackmap.ll
  llvm/test/CodeGen/SystemZ/stackmap.ll
  llvm/test/CodeGen/X86/selectiondag-patchpoint-legalize.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129268.442833.patch
Type: text/x-patch
Size: 22990 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220707/52b68fb5/attachment.bin>


More information about the llvm-commits mailing list