[PATCH] D51553: [DAGCombiner][x86] add transform/hook to load a scalar directly for use in a vector binop

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 1 10:02:44 PDT 2018


spatel updated this revision to Diff 167752.
spatel added a comment.

Patch updated:
No code changes, but I added 256/512-bit versions of the 128-bit tests that are affected by this patch.

The new results show that we are only transforming in the cases where we have legal ops for the type. Ie, this transform does not fire after we split the big vectors into the smaller legal vector type supported by the target. That's because we don't have an insert_vector_elt at that stage; it's a scalar_to_vector post-legalization.

So we can view the wider cases as conservatively ok here, but we should handle the pattern with scalar_to_vector as a follow-up. Or we might say that we don't want this transform to ever fire for bigger vector types? It's harder to justify this transform with the longer vectors if those instructions are executed as multi-uop sequences and/or have effects that we can't model (throttling the clock rate). OTOH, the transform is limited to insertion into element 0 currently, so the fact that we're using wide vector ops in these tests isn't necessary in the first place.


https://reviews.llvm.org/D51553

Files:
  include/llvm/CodeGen/TargetLowering.h
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  lib/Target/X86/X86ISelLowering.cpp
  lib/Target/X86/X86ISelLowering.h
  test/CodeGen/X86/load-scalar-as-vector.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51553.167752.patch
Type: text/x-patch
Size: 19597 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181001/1a0c2e82/attachment.bin>


More information about the llvm-commits mailing list