HomePhabricator

[InstSimplify] Properly constrain {insert,extract}_subvector intrinsic fold

Authored by joechrisellis on May 21 2021, 2:44 AM.

Description

[InstSimplify] Properly constrain {insert,extract}_subvector intrinsic fold

The previous rule:

(insert_vector _, (extract_vector X, 0), 0) -> X

is not quite correct. The correct fold should be:

(insert_vector Y, (extract_vector X, 0), 0) -> X
where: Y is X, or Y is undef

This commit updates the pattern.

Reviewed By: peterwaller-arm, paulwalker-arm

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