[PATCH] D144760: [InstCombine] use demanded vector elements to eliminate partially redundant instructions

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 24 14:24:09 PST 2023


spatel created this revision.
spatel added reviewers: nikic, efriedma, RKSimon, craig.topper.
Herald added subscribers: StephenFan, hiraditya, mcrosier.
Herald added a project: All.
spatel requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

In issue #60632 <https://github.com/llvm/llvm-project/issues/60632>, we have vector math ops that differ because an operand is shuffled, but the math has limited demanded elements, so it can be replaced by another instruction:
https://alive2.llvm.org/ce/z/TKqq7H

I don't think we have anything like this yet - it's like a CSE/GVN fold, but driven by demanded elements of a vector op.
This is limited to splat-0 as a first step to keep it simple and to save time in case it would be better to try this somewhere else.


https://reviews.llvm.org/D144760

Files:
  llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
  llvm/test/Transforms/InstCombine/vec_demanded_elts.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144760.500296.patch
Type: text/x-patch
Size: 10849 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230224/bd30900c/attachment.bin>


More information about the llvm-commits mailing list