2015-06-03 14:31:30 +08:00
{
2015-06-04 15:44:35 +08:00
"context" : "[N, p] -> { : N >= -9223372036854775808 and N <= 9223372036854775807 and p >= -9223372036854775808 and p <= 9223372036854775807 and p % 128 = 0}",
2015-06-03 14:31:30 +08:00
"name" : "for.cond => for.end",
"statements" : [
{
"accesses" : [
{
"kind" : "read",
"relation" : "[N, p] -> { Stmt_for_body[i0] -> MemRef_A[i0 % 128] }"
},
{
"kind" : "read",
2015-06-04 15:44:35 +08:00
"relation" : "[N, p] -> { Stmt_for_body[i0] -> MemRef_B[floor(i0 / 128)] }"
2015-06-03 14:31:30 +08:00
},
{
"kind" : "read",
"relation" : "[N, p] -> { Stmt_for_body[i0] -> MemRef_A[p % 128] }"
},
{
"kind" : "read",
[Polly] Track defined behavior for PHI predecessor computation.
ZoneAlgorithms's computePHI relies on being provided with consistent a
schedule to compute the statement prodecessors of a statement containing
PHINodes. Otherwise unexpected results such as PHI nodes with multiple
predecessors can occur which would result in problems in the
algorithms expecting consistent data.
In the added test case, statement instances are scrubbed from the
SCoP their execution would result in undefined behavior (Due to a nsw
overflow). As already being undefined behavior in LLVM-IR, neither
AssumedContext nor InvalidContext are updated, giving computePHI no
means to avoid these cases.
Intoduce a new SCoP property, the DefinedBehaviorContext, that among
the runtime-checked conditions, also tracks the assumptions not needing
a runtime check, in particular those affecting the assumed control flow.
This replaces the manual combination of the 3 other contexts that was
already done in computePHI and setNewAccessRelation. Currently, the only
additional assumption is that loop induction variables will nsw flag for
not wrap, but potentially more can be added. Use in
hasFeasibleRuntimeContext, isl::ast_build and gisting are other
potential uses.
To limit computational complexity, the DefinedBehaviorContext is not
availabe if it grows too large (atm hardcoded to 8 disjuncts).
Possible other fixes include bailing out in computePHI when
inconsistencies are detected, choose an arbitrary value for inconsistent
cases (since it is undefined behavior anyways), or make the code
receiving the result from ComputePHI handle inconsistent data. All of
them reduce the quality of implementation having to bail out more often
and disabling the ability to assert on actually wrong results.
This fixes llvm.org/PR48783.
2021-01-22 11:20:53 +08:00
"relation" : "[N, p] -> { Stmt_for_body[i0] -> MemRef_B[floor(p / 128)] }"
2015-06-03 14:31:30 +08:00
},
{
"kind" : "read",
"relation" : "[N, p] -> { Stmt_for_body[i0] -> MemRef_C[i0] }"
},
{
"kind" : "write",
"relation" : "[N, p] -> { Stmt_for_body[i0] -> MemRef_C[i0] }"
}
],
"domain" : "[N, p] -> { Stmt_for_body[i0] : i0 >= 0 and N >= 1 and i0 <= -1 + N }",
"name" : "Stmt_for_body",
"schedule" : "[N, p] -> { Stmt_for_body[i0] -> [i0] }"
}
]
}