This is an archive of the discontinued LLVM Phabricator instance.

[LoopSink] Add preheader to alias set
ClosedPublic

Authored by Carrot on Nov 16 2018, 4:20 PM.

Details

Summary

This patch fixes PR39695.

The original LoopSink only considers memory alias in loop body. But PR39695 shows that instructions following sink candidate in preheader should also be checked. This is a conservative patch, it simply adds whole preheader block to alias set. It may lose some optimization opportunity, but I think that is very rare because: 1 in the most common case st/ld to the same address, the load should already be optimized away. 2 usually preheader is not very large.

Diff Detail

Event Timeline

Carrot created this revision.Nov 16 2018, 4:20 PM
danielcdh accepted this revision.Nov 19 2018, 9:07 AM
This revision is now accepted and ready to land.Nov 19 2018, 9:07 AM
This revision was automatically updated to reflect the committed changes.