[SelectionDAG] Teach isConstOrConstSplat about ISD::SPLAT_VECTOR
authorFraser Cormack <fraser@codeplay.com>
Sat, 9 Jan 2021 17:12:22 +0000 (17:12 +0000)
committerFraser Cormack <fraser@codeplay.com>
Sat, 9 Jan 2021 20:54:34 +0000 (20:54 +0000)
commit41d06095b0d22c940538f10a5fb0f44d43769e7f
tree75e8dcc57095891ada1a587d00998a0ddf2bd5a7
parent03d249396d6b736447d529915e77dfeb84f2eeae
[SelectionDAG] Teach isConstOrConstSplat about ISD::SPLAT_VECTOR

This improves llvm::isConstOrConstSplat by allowing it to analyze
ISD::SPLAT_VECTOR nodes, in order to allow more constant-folding of
operations using scalable vector types.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D94168
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
llvm/test/CodeGen/AArch64/sve-intrinsics-int-compares-with-imm.ll
llvm/test/CodeGen/RISCV/rvv/vdiv-sdnode-rv32.ll
llvm/test/CodeGen/RISCV/rvv/vdivu-sdnode-rv32.ll