This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Don't remove free sext_inreg(vector_extract(x)) if it leads to multiple extracts
ClosedPublic

Authored by dmgreen on Feb 27 2023, 12:52 AM.

Details

Summary

If we have sext_inreg(vector_extract(x)) but the top bits are not used, DAG will try to remove the sext_inreg, using vector_extract(x) directly. This can lead to multiple uses of both sext_inreg(vector_extract(x)) and vector_extract(x), leading to the generation of both umov and smov extracts. This adds a target hook to prevent that under AArch64 where the sext_inreg can be considered free if there are multiple uses of the sext and no uses of the vector_extract. This helps fix a small regression from D144550.

Diff Detail

Event Timeline

dmgreen created this revision.Feb 27 2023, 12:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 27 2023, 12:52 AM
dmgreen requested review of this revision.Feb 27 2023, 12:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 27 2023, 12:52 AM
SjoerdMeijer accepted this revision.Feb 27 2023, 5:12 AM

Looks reasonable to me.

This revision is now accepted and ready to land.Feb 27 2023, 5:12 AM
This revision was landed with ongoing or failed builds.Feb 27 2023, 11:20 AM
This revision was automatically updated to reflect the committed changes.