This is an archive of the discontinued LLVM Phabricator instance.

[WIP][LICM] Just rely on AA rather than special case calls
AbandonedPublic

Authored by reames on Aug 10 2018, 3:44 PM.

Details

Summary

Obviously, not ready to check in... I was thinking about the assume and guard patches currently out for review and/or recently landed by Max and I. Something was really bugging me, and I finally realized what it was. The code we were adding in LICM was essentially duplicating support already in AliasSetTracker and BasicAA. We were extending the existing code structure, but it raised the question of whether this was the right approach.

This patch demonstrates that yes, all the special casing can be deleted. It needs cleanup (and a lot more testing), but it's rather telling there are no test changes observed. And BasicAA+AST is generally more powerful than the special cases which previously was in LICM. (I need to find such an example for a test.)

Anyone see a problem with this basic idea? I'm worried this is too good to be true and I must be missing something...

Diff Detail

Event Timeline

reames created this revision.Aug 10 2018, 3:44 PM
reames abandoned this revision.Aug 14 2018, 12:48 PM

This was too good to be true. The patch made an important conceptual mistake which is that it assumes an instruction maps to a single alias set. In general, this is not true. It may instead map to several distinct alias sets. For a bit more discussion of this, see https://reviews.llvm.org/D50730.

You could extend this approach to multiple aliasing sets, but once you do, you're basically back to the code I was replacing with an extra layer of abstraction added. Overall, that's not a net win.