forked from OSchip/llvm-project
CLooG: Do not take into account the context
CLooG and the CLooG based code generation does not yet correctly derive the types of the expressions, but just uses i64 for everything. This is incorrect, but works normally pretty well. However, the recent change of adding parameter bounds to the context made CLooG generate expressions that contain a lot of very large integers that possibly don't fit into an i64. This broke the code generation for several benchmarks. To get the CLooG based code generation working again, we just don't take into account any constraints in the context. This brings us back to the theoretical incorrect, but in practice generally correct code. The next step will be the isl based code generation. Here we will derive automatically correct types. llvm-svn: 158015
This commit is contained in:
parent
a59100cc08
commit
baa1ac260b
|
@ -185,7 +185,22 @@ CloogUnionDomain *Cloog::buildCloogUnionDomain() {
|
|||
}
|
||||
|
||||
CloogInput *Cloog::buildCloogInput() {
|
||||
CloogDomain *Context = cloog_domain_from_isl_set(S->getContext());
|
||||
// XXX: We do not copy the context of the scop, but use an unconstrained
|
||||
// context. This 'hack' is necessary as the context may contain bounds
|
||||
// on parameters such as [n] -> {:0 <= n < 2^32}. Those large
|
||||
// integers will cause CLooG to construct a clast that contains
|
||||
// expressions that include these large integers. Such expressions can
|
||||
// possibly not be evaluated correctly with i64 types. The cloog
|
||||
// based code generation backend, however, can not derive types
|
||||
// automatically and just assumes i64 types. Hence, it will break or
|
||||
// generate incorrect code.
|
||||
// This hack does not remove all possibilities of incorrectly generated
|
||||
// code, but it is ensures that for most problems the problems do not
|
||||
// show up. The correct solution, will be to automatically derive the
|
||||
// minimal types for each expression. This could be added to CLooG and it
|
||||
// will be available in the isl based code generation.
|
||||
isl_set *EmptyContext = isl_set_universe(S->getParamSpace());
|
||||
CloogDomain *Context = cloog_domain_from_isl_set(EmptyContext);
|
||||
CloogUnionDomain *Statements = buildCloogUnionDomain();
|
||||
|
||||
isl_set *ScopContext = S->getContext();
|
||||
|
|
Loading…
Reference in New Issue