[PATCH] D65533: [X86] In decomposeMulByConstant, legalize the VT before querying whether the multiply is legal

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 31 13:12:01 PDT 2019


craig.topper created this revision.
craig.topper added reviewers: spatel, RKSimon.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

If a type is larger than a legal type and needs to be split, we would previously allow the multiply to be decomposed even if the split multiply is legal. Since the shift + add/sub code would also need to be split, its not any better to decompose it.

This patch figures out what type the mul will eventually be legalized to and then uses that type for the query. I tried just returning false illegal types and letting them get handled after type legalization, but then we can't recognize and i64 constant splat on 32-bit targets since will be destroyed by type legalization. We could special case vectors of i64 to avoid that...


https://reviews.llvm.org/D65533

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65533.212646.patch
Type: text/x-patch
Size: 8529 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190731/82cced4c/attachment.bin>


More information about the llvm-commits mailing list