[PATCH] D60150: [DAGCombiner][x86] scalarize splatted vector FP ops

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 3 05:57:01 PDT 2019


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


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.h:1075
+      EVT EltVT = VecOp.getValueType().getScalarType();
+      return (EltVT == MVT::f32 || EltVT == MVT::f64) && !SplatIndex;
+    }
----------------
RKSimon wrote:
> I'm still amazed we haven't ended up with a isExtractElementCheap helper yet.
Yes, I went back and forth on how to structure and name this.

Just realized something though: the fold that I mentioned is in instcombine already exists here in the DAG. That would move splats (and other matching shuffles) after a binop because that's always a win (removes a shuffle). 

But the transform is currently limited by a seemingly unnecessary legality check, so that's why it didn't catch any of the cases that I was looking at.

Let me adjust that existing fold and see if that changes how we want to implement this hook. At the least, instead of starting the match from a binop, we'll start the match from the splat and then check the binop.


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

https://reviews.llvm.org/D60150





More information about the llvm-commits mailing list