This is an archive of the discontinued LLVM Phabricator instance.

[InstSimplify] Remove redundant {insert,extract}_vector intrinsic chains
ClosedPublic

Authored by joechrisellis on May 6 2021, 3:56 AM.

Details

Summary

This commit removes some redundant {insert,extract}_vector intrinsic
chains by implementing the following patterns as instsimplifies:

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

Diff Detail

Event Timeline

joechrisellis created this revision.May 6 2021, 3:56 AM
joechrisellis requested review of this revision.May 6 2021, 3:56 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMay 6 2021, 3:56 AM
Matt added a subscriber: Matt.May 7 2021, 8:27 AM
peterwaller-arm accepted this revision.May 12 2021, 7:22 AM
This revision is now accepted and ready to land.May 12 2021, 7:22 AM
This revision was landed with ongoing or failed builds.May 13 2021, 9:10 AM
This revision was automatically updated to reflect the committed changes.
paulwalker-arm added inline comments.
llvm/lib/Analysis/InstructionSimplify.cpp
5741–5747

Are you sure this transform is correct? I would have thought the following are safe:

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

when X->getType() == ReturnType but nothing else.