[PATCH] D46538: AMDGPU: Add combine for trunc of bitcast from build_vector

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 7 11:23:27 PDT 2018


arsenm created this revision.
arsenm added reviewers: rampitec, kzhuravl, Farhana.
Herald added subscribers: t-tye, tpr, dstuttard, yaxunl, nhaehnle, wdng.

If the truncate is only accessing the first element of the vector,
we can use the original source value.

      

This helps with some combine ordering issues after operations are
lowered to integer operations between bitcasts of build_vector.
In particular it stops unnecessarily materializing the unused
top half of a vector in some cases.


https://reviews.llvm.org/D46538

Files:
  lib/Target/AMDGPU/AMDGPUISelLowering.cpp
  lib/Target/AMDGPU/AMDGPUISelLowering.h
  test/CodeGen/AMDGPU/function-returns.ll
  test/CodeGen/AMDGPU/llvm.amdgcn.image.gather4.d16.ll
  test/CodeGen/AMDGPU/llvm.amdgcn.image.sample.d16.ll
  test/CodeGen/AMDGPU/store-weird-sizes.ll
  test/CodeGen/AMDGPU/trunc-combine.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46538.145504.patch
Type: text/x-patch
Size: 16212 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180507/221d03a3/attachment.bin>


More information about the llvm-commits mailing list