This is an archive of the discontinued LLVM Phabricator instance.

[Polly][OpTree] Introduce shortcut for computing the def->target mapping. NFCI.
ClosedPublic

Authored by Meinersbur on Jun 4 2018, 6:22 PM.

Details

Summary

In case the schedule has not changed and the operand tree root uses a value defined in an ancestor loop, the def-to-target mapping is trivial. Let the SCoP be

    for (int i < 0; i < N; i+=1) {
  DefStmt:
    D = ...;
    for (int j < 0; j < N; j+=1) {
  TargetStmt:
     use(D);
  }
}

then the DefStmt-to-TargetStmt mapping is

{ DefStmt[i] -> TargetStmt[i,j] }

This case should apply on the majority of cases. This patch detects this case and directly construct the expected mapping. This assumes that the mapping never crosses the loop header DefStmt is in, which ForwardOpTree does not support at the moment anyway.

This should fix the timeout while compiling GrTestUtils.cpp of the Qualcom aosp buildbot. It still needs nearly 5 minutes to compile (which should be below the timeout), but no noticeable time is spent in the getDefToTarget function anymore.

Diff Detail

Repository
rL LLVM

Event Timeline

Meinersbur created this revision.Jun 4 2018, 6:22 PM
grosser accepted this revision.Jun 6 2018, 9:55 AM

Cool.

This revision is now accepted and ready to land.Jun 6 2018, 9:55 AM
This revision was automatically updated to reflect the committed changes.