[PATCH] D74495: [VectorCombine] try to form vector binop to eliminate an extract element

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 13 13:01:52 PST 2020


lebedev.ri marked an inline comment as done.
lebedev.ri added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/VectorCombine.cpp:89
+
+  // Match a scalar binop with extracted vector operands:
+  // bo (extelt X, C0), (extelt Y, C1)
----------------
spatel wrote:
> lebedev.ri wrote:
> > Hm, and if there is only one extract, and the other operand is constant,
> > we consider that vectorizing the constant in some way will always be costlier?
> > Just thinking out loud, not for this patch.
> This would imply that the vector binop is cheaper than the scalar binop since we would have the same extract either way. As I mentioned in an earlier comment, I haven't found that case yet on x86, but it's possible it exists for some binop on some subtarget.
I'm mainly just trying to think of plausible edge cases that we might care about, but just didn't think of.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74495/new/

https://reviews.llvm.org/D74495





More information about the llvm-commits mailing list