[PATCH] D24279: [InstCombine] canonicalize vector select with constant vector condition to shuffle

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 13 11:11:58 PDT 2016


spatel added a comment.

In https://reviews.llvm.org/D24279#541376, @mkuper wrote:

> Did you happen to check that we don't regress codegen for the IR tests that changed? At least X86? (This should probably go in even if it does regress some cases, but a PR would be good.)


Yes - x86 is the easy target because the x86 DAG combining/lowering already turns vselect into shuffle which then gets matched to blend or whatever shuffle instruction scraps are available before SSE4.1.

There is one existing problem for x86 that becomes slightly worse with this change. It manifests in vec_demanded_elts.ll:test_select(), and I just filed PR30371 (https://llvm.org/bugs/show_bug.cgi?id=30371) for that. That test also demonstrates a missing InstCombine fold that could fuse an insertelement with a later shuffle, but even if we had that fold, the x86 backend would screw up the codegen. :)

I filed https://llvm.org/bugs/show_bug.cgi?id=28530 for AArch64.


https://reviews.llvm.org/D24279





More information about the llvm-commits mailing list