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

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 12:54:27 PDT 2020


spatel created this revision.
spatel added reviewers: craig.topper, RKSimon, lebedev.ri.
Herald added subscribers: hiraditya, kristof.beyls, mcrosier.
Herald added a project: LLVM.

Try to combine N short vector cast ops into 1 wide vector cast op:
concat (cast X), (cast Y)... -> cast (concat X, Y...)

This is part of solving PR45794:
https://bugs.llvm.org/show_bug.cgi?id=45794

As noted in the code comment, this is uglier than I was hoping because the opcode determines whether we pass the source or destination type to isOperationLegalOrCustom(). Also IIUC, there's no way to validate what the other (dest or src) type is. Without the extra legality check on that, there's an ARM regression test in test/CodeGen/ARM/isel-v8i32-crash.ll that will crash trying to lower an unsupported v8f32 to v8i16.


https://reviews.llvm.org/D79360

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/test/CodeGen/X86/avx-shift.ll
  llvm/test/CodeGen/X86/concat-cast.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79360.261908.patch
Type: text/x-patch
Size: 15476 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200504/903a2ec6/attachment-0001.bin>


More information about the llvm-commits mailing list