Page MenuHomePhabricator

IR. Change strip* family of functions to not look through aliases.

Authored by pcc on Aug 22 2019, 10:52 AM.



I noticed another instance of the issue where references to aliases were
being replaced with aliasees, this time in InstCombine. In the instance that
I saw it turned out to be only a QoI issue (a symbol ended up being missing
from the symbol table due to the last reference to the alias being removed,
preventing HWASAN from symbolizing a global reference), but it could easily
have manifested as incorrect behaviour.

Since this is the third such issue encountered (previously: D65118, D65314)
it seems to be time to address this common error/QoI issue once and for all
and make the strip* family of functions not look through aliases.

Includes a test for the specific issue that I saw, but no doubt there are
other similar bugs fixed here.

As with D65118 this has been tested to make sure that the optimization isn't
load bearing. I built Clang, Chromium for Linux, Android and Windows as well
as the test-suite and there were no size regressions.

Diff Detail


Event Timeline

pcc created this revision.Aug 22 2019, 10:52 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptAug 22 2019, 10:52 AM
pcc added a subscriber: jdoerfert.Aug 22 2019, 10:53 AM
rnk accepted this revision.Aug 22 2019, 12:39 PM


GlobalOpt already replaces replaceable aliases, and if it doesn't do it enough, we can adjust the pass pipeline to fix the phase ordering problem.

This revision is now accepted and ready to land.Aug 22 2019, 12:39 PM
This revision was automatically updated to reflect the committed changes.