This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][GlobalISel] Run overlapping_and after legalization
ClosedPublic

Authored by paquette on Sep 28 2021, 4:03 PM.

Details

Summary

When we have code with truncates, those truncates may be changed into G_ANDs with constants. These may, in turn, feed into other G_AND instructions.

Running this combine post-legalize allows us to optimize examples like this one:

https://godbolt.org/z/zrGY4dfEW

SDAG currently optimizes the example above so that there is only one and. GISel doesn't optimize it, because the G_AND we'd optimize here is translated as a G_TRUNC. Later, that G_TRUNC is turned into a G_AND during legalization.

Diff Detail

Event Timeline

paquette created this revision.Sep 28 2021, 4:03 PM
paquette requested review of this revision.Sep 28 2021, 4:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 28 2021, 4:03 PM
aemerson accepted this revision.Sep 28 2021, 4:39 PM
This revision is now accepted and ready to land.Sep 28 2021, 4:39 PM
This revision was landed with ongoing or failed builds.Sep 28 2021, 5:14 PM
This revision was automatically updated to reflect the committed changes.