[PATCH] D92645: [X86] Add X86ISD::SUBV_BROADCAST_LOAD and begin removing X86ISD::SUBV_BROADCAST (PR38969)

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 14 04:37:37 PST 2020


RKSimon added inline comments.


================
Comment at: llvm/test/CodeGen/X86/vector-trunc.ll:119
 ; AVX2-FAST:       # %bb.0: # %entry
-; AVX2-FAST-NEXT:    vmovaps {{.*#+}} xmm2 = [1,3,5,7]
+; AVX2-FAST-NEXT:    vbroadcastf128 {{.*#+}} ymm2 = [1,3,5,7,1,3,5,7]
+; AVX2-FAST-NEXT:    # ymm2 = mem[0,1,0,1]
----------------
yubing wrote:
> RKSimon wrote:
> > pengfei wrote:
> > > Seems vmovaps better here.
> > Yes - I should have explained - LowerBUILD_VECTOR doesn't recognise undef upper elements until AFTER its tried lowerBuildVectorAsBroadcast, and because we have multiple uses SimplifyDemandedVectorElts won't touch it. 
> > 
> > I'll adjust LowerBUILD_VECTOR separately and update this patch.
> Eh, Simon. Why we lower constant BuildVector into Broadcast only when it has more than one use? I saw that lowerBuildVectorAsBroadcast(...) calls isFoldableUseOfShuffle(...) which returns true if it has one use.
Because otherwise it interferes with folding the vector loads into instructions, resulting in increased register pressure. You can see the effect by editing isFoldableUseOfShuffle to just return false.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92645



More information about the llvm-commits mailing list