[PATCH] D79003: [DAG] Add SimplifyDemandedVectorElts binop SimplifyMultipleUseDemandedBits handling

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 14:32:22 PDT 2020


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


================
Comment at: llvm/test/CodeGen/AArch64/mul_by_elt.ll:145
   ret <4 x float> %mul2
 }
 
----------------
craig.topper wrote:
> RKSimon wrote:
> > Not sure about this change - it strips the first shufflevector entirely losing the multiply by scalar, but instcombine would have done something similar anyhow:
> > ```
> > define <4 x float> @splat0_before_fmul_fmul_constant(<4 x float> %a) {
> >   %1 = fmul <4 x float> %a, <float 3.000000e+00, float undef, float undef, float undef>
> >   %2 = fmul <4 x float> %1, <float 6.000000e+00, float undef, float undef, float undef>
> >   %mul2 = shufflevector <4 x float> %2, <4 x float> undef, <4 x i32> zeroinitializer
> >   ret <4 x float> %mul2
> > }
> > ```
> Why does "multiple use" come into play here?
Because SimplifyMultipleUseDemandedBits will peek through a shuffle entirely but SimplifyDemandedVectorElts is (overly) careful at not simplifying to an identity shuffle - which tbh is something we should get rid of.

I'm not sure why the constant splat isn't being used as the scalar operand as an alternative though.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79003





More information about the llvm-commits mailing list