[SDAG] allow more cast folding for vector sext-of-setcc
authorSanjay Patel <spatel@rotateright.com>
Wed, 2 Jun 2021 16:55:46 +0000 (12:55 -0400)
committerSanjay Patel <spatel@rotateright.com>
Wed, 2 Jun 2021 17:14:49 +0000 (13:14 -0400)
commitede3982792dfc6c00a4f185f88ce0e799e2545af
tree9987a96667f067b59797062be903af33d397ae19
parent8349ac9aa944525e2da5ebd4c7a09b9a98aab0eb
[SDAG] allow more cast folding for vector sext-of-setcc

This is a follow-up to D103280 that eases the use restrictions,
so we can handle the motivating case from:
https://llvm.org/PR50055

The loop code is adapted from similar use checks in
ExtendUsesToFormExtLoad() and SliceUpLoad(). I did not see an
easier way to filter out non-chain uses of load values.

Differential Revision: https://reviews.llvm.org/D103462
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/X86/sext-vsetcc.ll