[PATCH] D74576: GlobalISel: Don't try to narrow extending loads/trunc store

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 13 12:24:30 PST 2020


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

If the loaded memory size was smaller than the result size, this would
produce out of bounds memory accesses. I'm wondering if we need a
distinct narrow memory legalize action type, since a case I care about
is decomposing a 4-byte unaligned access into 4 extending loads, which
would leave the original result register type. I'm currently awkwardly
using narrowScalar to handle unaligned accesses that need to be split.


https://reviews.llvm.org/D74576

Files:
  llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
  llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-constant.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-flat.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-global.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-local.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-private.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-store-global.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74576.244505.patch
Type: text/x-patch
Size: 365803 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200213/ab5377ed/attachment-0001.bin>


More information about the llvm-commits mailing list