HomePhabricator

[SelectionDAG] Allow constant folding for implicitly truncating BUILD_VECTOR…

Description

[SelectionDAG] Allow constant folding for implicitly truncating BUILD_VECTOR nodes.

In FoldConstantArithmetic, handle BUILD_VECTOR nodes that do implicit truncation on the elements.

This is similar to what is done in FoldConstantVectorArithmetic.

Differential Revision:
https://reviews.llvm.org/D36506