aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineModuleInfo.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@sifive.com>2021-04-07 10:03:31 -0700
committerCraig Topper <craig.topper@sifive.com>2021-04-07 10:03:33 -0700
commit67953311e2e370a9fcf77595d66d39c505565382 (patch)
treeea30468680d28f80ad779d611e58941272a179b6 /llvm/lib/CodeGen/MachineModuleInfo.cpp
parent5fc0e98d9a06e0fdd8cbd8dbf374bc002497db7e (diff)
downloadllvm-67953311e2e370a9fcf77595d66d39c505565382.zip
llvm-67953311e2e370a9fcf77595d66d39c505565382.tar.gz
llvm-67953311e2e370a9fcf77595d66d39c505565382.tar.bz2
[SelectionDAG] Teach SelectionDAG::FoldConstantArithmetic to handle SPLAT_VECTOR
This allows FoldConstantArithmetic to handle SPLAT_VECTOR in addition to BUILD_VECTOR. This allows it to support scalable vectors. I'm also allowing fixed length SPLAT_VECTOR which is used by some targets, but I'm not familiar enough to write tests for those targets. I had to block this function from running on CONCAT_VECTORS to avoid calling getNode for a CONCAT_VECTORS of 2 scalars. This can happen because the 2 operand getNode calls this function for any opcode. Previously we were protected because CONCAT_VECTORs of BUILD_VECTOR is folded to a larger BUILD_VECTOR before that call. But it's not always possible to fold a CONCAT_VECTORS of SPLAT_VECTORs, and we don't even try. This fixes PR49781 where DAG combine thought constant folding should be possible, but FoldConstantArithmetic couldn't do it. Reviewed By: david-arm Differential Revision: https://reviews.llvm.org/D99682
Diffstat (limited to 'llvm/lib/CodeGen/MachineModuleInfo.cpp')
0 files changed, 0 insertions, 0 deletions