[PATCH] D74064: [Analysis] add query to get splat value from array of ints

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 5 08:59:26 PST 2020


spatel created this revision.
spatel added reviewers: craig.topper, efriedma, lebedev.ri, RKSimon.
Herald added subscribers: hiraditya, mcrosier.
Herald added a project: LLVM.

I was debug stepping through an x86 shuffle lowering and noticed we were doing an N^2 search for splat index. I didn't find the equivalent functionality anywhere else in LLVM, so here's a helper that takes an array of int and returns a splatted index while ignoring undefs (any negative value).

This might also be used inside existing ShuffleVectorInst/ShuffleVectorSDNode functions and/or help with D72467 <https://reviews.llvm.org/D72467>.


https://reviews.llvm.org/D74064

Files:
  llvm/include/llvm/Analysis/VectorUtils.h
  llvm/lib/Analysis/VectorUtils.cpp
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/unittests/Analysis/VectorUtilsTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74064.242642.patch
Type: text/x-patch
Size: 4131 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200205/bfb8b9cb/attachment.bin>


More information about the llvm-commits mailing list