This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by guyblank on Aug 8 2017, 11:00 PM.

Details

Summary

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

This is similar to what is done in FoldConstantVectorArithmetic.

Diff Detail

Event Timeline

guyblank created this revision.Aug 8 2017, 11:00 PM
RKSimon accepted this revision.Aug 10 2017, 3:39 AM

LGTM. The duplication between this and FoldConstantVectorArithmetic suggests that a merging is overdue - add a TODO comment?

This revision is now accepted and ready to land.Aug 10 2017, 3:39 AM

Sure, I'll add a TODO, thanks.

This revision was automatically updated to reflect the committed changes.