[PATCH] D58282: [x86] scalarize extract element 0 of FP math

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 21 16:00:40 PST 2019


spatel marked 4 inline comments as done.
spatel added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:34233
+  case ISD::FMINNUM_IEEE: case ISD::FMAXNUM_IEEE:
+  case ISD::FMAXIMUM: case ISD::FMINIMUM: {
+    // extract (fp X, Y, ...), 0 --> fp (extract X, 0), (extract Y, 0), ...
----------------
RKSimon wrote:
> (style) Is clang-format happy with this?
Definitely not. :)
I was trying to keep the list organized and save space while fetching things from the header file, but that didn't last. I'll fix it to use the standard 1-case-per-line.


================
Comment at: llvm/test/CodeGen/X86/extractelement-fp.ll:138
   %v = call <4 x float> @llvm.sqrt.v4f32(<4 x float> %x)
   %r = extractelement <4 x float> %v, i32 0
   ret float %r
----------------
RKSimon wrote:
> Should unary ops handle non-zero index extractions?
There's some set of conditions under which we want to do that, but I don't think unary alone is it. For example, it probably makes sense to shuffle an fdiv to avoid the vector op. Also, anything that would get expanded via unrolling during legalization? I'll add a TODO note so we can follow-up.


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

https://reviews.llvm.org/D58282





More information about the llvm-commits mailing list