[DAGCombiner] Relax an assertion to an early return
authorFraser Cormack <fraser@codeplay.com>
Thu, 13 May 2021 11:18:36 +0000 (12:18 +0100)
committerFraser Cormack <fraser@codeplay.com>
Mon, 17 May 2021 08:15:55 +0000 (09:15 +0100)
commit85e31eddf216181c6b8b26bca760f3395d621f9a
treef6aa6f9020c887f94b4396843ff879e0b345c07f
parenta18b5f0188b5929a58790dd0f57c06098d276fd1
[DAGCombiner] Relax an assertion to an early return

The select-of-constants transform was asserting that its constant vector
inputs did not implicitly truncate their input without that as an
explicit precondition to the function. This patch relaxes that assertion
into an early return to skip the optimization.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D102393
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/RISCV/rvv/select-sra.ll [new file with mode: 0644]