[PATCH] D55722: [DAGCombiner] scalarize binop followed by extractelement

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 15 06:58:04 PST 2018


spatel marked an inline comment as done.
spatel added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:15578
+    // extractelt (binop X, C), IndexC --> binop (extractelt X, IndexC), C'
+    // extractelt (binop C, X), IndexC --> binop C', (extractelt X, IndexC)
+    SDLoc DL(ExtElt);
----------------
RKSimon wrote:
> I wonder whether we need a oneuse check on the constant as well? Some of the cases below suggest that a vector constant load might be happening whatever.
If we put a one-use check on the constant, the effect will be to remove all of the horizontal-reduce-* and vector-reduce-* diffs from this patch. 

I thought those were good changes though - better to get the data out of the vector unit as soon as possible since we know we're going to end up in a scalar?


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

https://reviews.llvm.org/D55722





More information about the llvm-commits mailing list