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

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.
For instance, the SCoP

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

has DefStmt-to-TargetStmt mapping of

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

This should apply on the majority of def-to-target mappings.
This patch detects this case and directly constructs the expected
mapping. It assumes that the mapping never crosses the loop header
DefStmt is in, which ForwardOpTree does not support at the moment
anyway.

Differential Revision: https://reviews.llvm.org/D47752

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@334134 91177308-0d34-0410-b5e6-96231b3b80d8
3 files changed