diff options
| author | Siddharth Bhat <siddu.druid@gmail.com> | 2017-09-07 11:57:33 +0000 |
|---|---|---|
| committer | Siddharth Bhat <siddu.druid@gmail.com> | 2017-09-07 11:57:33 +0000 |
| commit | e2950f46c66b9a3547839fd4cd3598fb5bfcf412 (patch) | |
| tree | 6bf344e7d9cffc1cd55847f8171cf2e925920ab1 /polly/lib/CodeGen/PPCGCodeGeneration.cpp | |
| parent | cf0cdd4c027d02a99c945f7d0c5ceb959cac8d99 (diff) | |
[PPCGCodeGen] Document pre-composition with Zero in getExtent. [NFC]
It's weird at first glance that we do this, so I wrote up some
documentation on why we need to perform this process.
llvm-svn: 312715
Diffstat (limited to 'polly/lib/CodeGen/PPCGCodeGeneration.cpp')
| -rw-r--r-- | polly/lib/CodeGen/PPCGCodeGeneration.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp index 03625318c767..a6e7867127e4 100644 --- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp +++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp @@ -2922,6 +2922,32 @@ public: isl_pw_aff *Bound = Array->getDimensionSizePw(i).release(); auto LS = isl_pw_aff_get_domain_space(Bound); auto Aff = isl_multi_aff_zero(LS); + + // We need types to work out, which is why we perform this weird dance + // with `Aff` and `Bound`. Consider this example: + + // LS: [p] -> { [] } + // Zero: [p] -> { [] } | Implicitly, is [p] -> { ~ -> [] }. + // This `~` is used to denote a "null space" (which is different from + // a *zero dimensional* space), which is something that ISL does not + // show you when pretty printing. + + // Bound: [p] -> { [] -> [(10p)] } | Here, the [] is a *zero dimensional* + // space, not a "null space" which does not exist at all. + + // When we pullback (precompose) `Bound` with `Zero`, we get: + // Bound . Zero = + // ([p] -> { [] -> [(10p)] }) . ([p] -> {~ -> [] }) = + // [p] -> { ~ -> [(10p)] } = + // [p] -> [(10p)] (as ISL pretty prints it) + // Bound Pullback: [p] -> { [(10p)] } + + // We want this kind of an expression for Bound, without a + // zero dimensional input, but with a "null space" input for the types + // to work out later on, as far as I (Siddharth Bhat) understand. + // I was unable to find a reference to this in the ISL manual. + // References: Tobias Grosser. + Bound = isl_pw_aff_pullback_multi_aff(Bound, Aff); Bounds.push_back(Bound); } |
