[PATCH] D80056: GlobalISel: Merge G_PTR_MASK with llvm.ptrmask intrinsic

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 15 18:29:19 PDT 2020


arsenm created this revision.
arsenm added reviewers: aemerson, aditya_nandakumar, paquette, gargaroff, volkan, fhahn, dsanders.
Herald added subscribers: kerbowa, hiraditya, arichardson, rovka, nhaehnle, wdng, jvesely.
Herald added a project: LLVM.

Confusingly, these were unrelated and had different semantics. The
G_PTR_MASK instruction predates the llvm.ptrmask intrinsic, but has a
different format. G_PTR_MASK only allows clearing the low bits of a
pointer, and only a constant number of bits. The ptrmask intrinsic
allows an arbitrary mask. Replace G_PTR_MASK to match the intrinsic.

      

Only selects the cases that look like the old instruction. More work
is needed to select the general case. Also new legalization code is
still needed to deal with the case where the incoming mask size does
not match the pointer size, which has a specified behavior in the
langref.


https://reviews.llvm.org/D80056

Files:
  llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
  llvm/include/llvm/Support/TargetOpcodes.def
  llvm/include/llvm/Target/GenericOpcodes.td
  llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
  llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
  llvm/lib/CodeGen/MachineVerifier.cpp
  llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
  llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp
  llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
  llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.h
  llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
  llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/legalize-vaarg.mir
  llvm/test/CodeGen/AArch64/GlobalISel/legalizer-info-validation.mir
  llvm/test/CodeGen/AArch64/GlobalISel/select.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-ptr-mask.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-ptrmask.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/irtranslator-ptrmask.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-ptrmask.mir
  llvm/test/MachineVerifier/test_g_ptrmask.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80056.264403.patch
Type: text/x-patch
Size: 69846 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200516/718b864b/attachment.bin>


More information about the llvm-commits mailing list