[PATCH] D85129: [DAG] Fold vector (aext (load x)) -> (zext (truncate (zextload x)))

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 3 05:52:12 PDT 2020


RKSimon created this revision.
RKSimon added reviewers: spatel, craig.topper, lebedev.ri, efriedma.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.
RKSimon requested review of this revision.

We currently don't do anything to fold any_extend vector loads as no target has such an instruction.

Instead I've added support for folding to a zextload, SimplifyDemandedBits does a good job of adjusting the zext(truncate(()) stages as required later on.

We still need the custom scalar extload handling instead of using the tryToFoldExtOfLoad helper as it has different legality tests - we can probably tweak that to reduce most of the code duplication.

Fixes the regression I mentioned in rG99a971cadff7 <https://reviews.llvm.org/rG99a971cadff7832a846394462c39a74aac64325d>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D85129

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/test/CodeGen/X86/avx512-any_extend_load.ll
  llvm/test/CodeGen/X86/avx512-shuffles/partial_permute.ll
  llvm/test/CodeGen/X86/vector-mul.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85129.282603.patch
Type: text/x-patch
Size: 6746 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200803/595b16ea/attachment.bin>


More information about the llvm-commits mailing list