[PATCH] D79360: [DAGCombiner] sink target-supported cast op after concat vectors

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 16:09:30 PDT 2020


craig.topper added inline comments.


================
Comment at: llvm/test/CodeGen/X86/avx-shift.ll:177
+; CHECK-NEXT:    vinsertf128 $1, %xmm1, %ymm0, %ymm0
+; CHECK-NEXT:    vcvttps2dq %ymm0, %ymm0
 ; CHECK-NEXT:    retq
----------------
spatel wrote:
> craig.topper wrote:
> > Do we do the best thing if the shl is used by another operation that needs to be split? Do we keep the vcvttps2dq split?
> Does the next test (vshift08_add) cover the scenario you're thinking of? There's no difference on that one because the concat isn't directly after the cast.
I think it does.

Let me see if this works how I think it does. The shift will be legalized by LegalizeVectorOps first because we run that stage by legalizing operands before users. So the shift gets lowered first. When the shift gets lowered, it should split and produce a concat. Then each part of the split should get legalized. Then the add gets legalized which produces another split. getNode for the extracts for that split will look through the concat produced by the shift? Leaving that concat dead. Then a new concat will be produced for the add split?


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

https://reviews.llvm.org/D79360





More information about the llvm-commits mailing list