[PATCH] D150002: [AMDGPU] Fix crash with 160-bit p7's by manually defining getPointerTy

Krzysztof Drewniak via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 12 09:49:22 PDT 2023


krzysz00 added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIISelLowering.cpp:990
+MVT SITargetLowering::getPointerTy(const DataLayout &DL, unsigned AS) const {
+  if (AMDGPUAS::BUFFER_FAT_POINTER == AS && DL.getPointerSizeInBits(AS) > 128)
+    return MVT::v5i32;
----------------
foad wrote:
> Nit: why do you need the getPointerSizeInBits test?
Paranoia around making sure this isn't an old data layout or the like. I might even want to make the check more precise.


================
Comment at: llvm/lib/Target/AMDGPU/SIISelLowering.cpp:990
+MVT SITargetLowering::getPointerTy(const DataLayout &DL, unsigned AS) const {
+  if (AMDGPUAS::BUFFER_FAT_POINTER == AS && DL.getPointerSizeInBits(AS) > 128)
+    return MVT::v5i32;
----------------
foad wrote:
> krzysz00 wrote:
> > foad wrote:
> > > Nit: why do you need the getPointerSizeInBits test?
> > Paranoia around making sure this isn't an old data layout or the like. I might even want to make the check more precise.
> I mean why do you need it at all? Don't we know statically that the size of BUFFER_FAT_POINTER is 160 bits?
I was concerned that, for example, auto-upgrade might not fire or that you'd otherwise end up in a position where `p7` doesn't have its usual definition and so thought to go ahead and check.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150002/new/

https://reviews.llvm.org/D150002



More information about the llvm-commits mailing list