[PATCH] D141739: DAG: Avoid stack lowering if bitcast has an illegal vector result type

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 13 17:07:26 PST 2023


arsenm created this revision.
arsenm added reviewers: bogner, rampitec, foad, craig.topper, RKSimon, Pierre-vh.
Herald added subscribers: kosarev, StephenFan, kerbowa, hiraditya, jvesely.
Herald added a project: All.
arsenm requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

A bitcast of <10 x i32> to <5 x i64> was ending up on the
stack. Instead of doing that, handle the case where the new type
doesn't evenly divide but the elements do. Extract the individual
elements and pad with undef.

      

Avoids stack usage for bitcasts involving <5 x i64>. In some of these
cases, later optimizations actually eliminated the stack objects but
left behind the unused temporary stack object to final emission.

      

Fixes: SWDEV-377548


https://reviews.llvm.org/D141739

Files:
  llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
  llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.ll
  llvm/test/CodeGen/AMDGPU/copy-illegal-type.ll
  llvm/test/CodeGen/AMDGPU/copy-to-reg-scc-clobber.ll
  llvm/test/CodeGen/AMDGPU/flat_atomics_i64.ll
  llvm/test/CodeGen/AMDGPU/global_atomics_i64.ll
  llvm/test/CodeGen/AMDGPU/insert_vector_dynelt.ll
  llvm/test/CodeGen/AMDGPU/select.f16.ll
  llvm/test/CodeGen/AMDGPU/v_madak_f16.ll
  llvm/test/CodeGen/AMDGPU/vector_shuffle.packed.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141739.489156.patch
Type: text/x-patch
Size: 40254 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230114/0871110e/attachment.bin>


More information about the llvm-commits mailing list