[llvm] r293273 - [LICM] When we are recomputing the alias sets for a subloop, we cannot

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 21 11:14:00 PST 2017


Merged to 4.0 in r295748, without the test as discussed on PR31187.

On Fri, Jan 27, 2017 at 2:27 AM, Chandler Carruth via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: chandlerc
> Date: Fri Jan 27 04:27:32 2017
> New Revision: 293273
>
> URL: http://llvm.org/viewvc/llvm-project?rev=293273&view=rev
> Log:
> [LICM] When we are recomputing the alias sets for a subloop, we cannot
> skip sub-subloops.
>
> The logic to skip subloops dated from when this code was shared with the
> cached case. Once it was factored out to only run in the case of
> recomputed subloops it became a dangerous bug. If a subsubloop contained
> an interfering instruction it would be silently skipped from the alias
> sets for LICM.
>
> With the old pass manager this was extremely hard to trigger as it would
> require failing to visit these subloops with the LICM pass but then
> visiting the outer loop somehow. I've not yet contrived any test case
> that actually manages to trigger this.
>
> But with the new pass manager we don't do the cross-loop caching hack
> that the old PM does and so we recompute alias set information from
> first principles. While this seems much cleaner and simpler it exposed
> this bug and would subtly miscompile code due to failing to correctly
> model the aliasing constraints of deeply nested loops.
>
> Added:
>     llvm/trunk/test/Transforms/LICM/unrolled-deeply-nested.ll
> Modified:
>     llvm/trunk/lib/Transforms/Scalar/LICM.cpp


More information about the llvm-commits mailing list