This is an archive of the discontinued LLVM Phabricator instance.

[UnJ] Update LI for inner nested loops
ClosedPublic

Authored by dmgreen on May 27 2020, 3:42 AM.

Details

Summary

This makes sure to correctly register the loop info of the child loops of unroll and jammed loops. It re-uses some code from the unroller for registering subloops.

Note that I just found D73129 again whilst writing this summary. This is a smaller version of the same thing. My understanding is that the plan is to change unroll and jam to jam the inner loop? (although I thought some of that was already done?). This fixes the problem in a minimal way until then.

Diff Detail

Event Timeline

dmgreen created this revision.May 27 2020, 3:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 27 2020, 3:42 AM
dmgreen updated this revision to Diff 266476.May 27 2020, 3:44 AM
Meinersbur accepted this revision.May 27 2020, 4:37 AM

LGTM. Thank you.

This revision is now accepted and ready to land.May 27 2020, 4:37 AM
Whitney added inline comments.May 27 2020, 5:00 AM
llvm/test/Transforms/LoopUnrollAndJam/innerloop.ll
2

nit: remove this line as the checks don't look like autogenerated by utils/update_test_checks.py.

3

Add a run line for new pass manager.
No need -unroll-and-jam-count=4 as there exists metadata which indicate to unroll and jam the middle loop by 4.
Suggest to add -verify-loop-info or -passes='verify<loops>' to explicitly test the loop info is correct after unroll and jam.

Example:

; RUN: opt -basicaa -tbaa -loop-unroll-and-jam -allow-unroll-and-jam -verify-loop-info < %s -S | FileCheck %s
; RUN: opt -aa-pipeline=type-based-aa,basic-aa -passes='unroll-and-jam,verify<loops>' -allow-unroll-and-jam < %s -S | FileCheck %s
This revision was automatically updated to reflect the committed changes.