summaryrefslogtreecommitdiffstats
path: root/polly/lib/CodeGen/IslAst.cpp
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2016-06-11 19:17:15 +0000
committerTobias Grosser <tobias@grosser.es>2016-06-11 19:17:15 +0000
commit3717aa5ddbf9bd5b14f9604b5bd0803dc7e8fe8a (patch)
tree2d274550963818cd6987ea447de338ba1cb68c5c /polly/lib/CodeGen/IslAst.cpp
parent594ffa3d368ef069f56916fc126ae43493a8fb7f (diff)
downloadbcm5719-llvm-3717aa5ddbf9bd5b14f9604b5bd0803dc7e8fe8a.tar.gz
bcm5719-llvm-3717aa5ddbf9bd5b14f9604b5bd0803dc7e8fe8a.zip
This reverts recent expression type changes
The recent expression type changes still need more discussion, which will happen on phabricator or on the mailing list. The precise list of commits reverted are: - "Refactor division generation code" - "[NFC] Generate runtime checks after the SCoP" - "[FIX] Determine insertion point during SCEV expansion" - "Look through IntToPtr & PtrToInt instructions" - "Use minimal types for generated expressions" - "Temporarily promote values to i64 again" - "[NFC] Avoid unnecessary comparison for min/max expressions" - "[Polly] Fix -Wunused-variable warnings (NFC)" - "[NFC] Simplify min/max expression generation" - "Simplify the type adjustment in the IslExprBuilder" Some of them are just reverted as we would otherwise get conflicts. I will try to re-commit them if possible. llvm-svn: 272483
Diffstat (limited to 'polly/lib/CodeGen/IslAst.cpp')
-rw-r--r--polly/lib/CodeGen/IslAst.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/polly/lib/CodeGen/IslAst.cpp b/polly/lib/CodeGen/IslAst.cpp
index f5249548097..5bcd784dacd 100644
--- a/polly/lib/CodeGen/IslAst.cpp
+++ b/polly/lib/CodeGen/IslAst.cpp
@@ -331,7 +331,8 @@ buildCondition(__isl_keep isl_ast_build *Build, const Scop::MinMaxAccessTy *It0,
return NonAliasGroup;
}
-__isl_give isl_ast_expr *IslAst::buildRunCondition() {
+__isl_give isl_ast_expr *
+IslAst::buildRunCondition(Scop *S, __isl_keep isl_ast_build *Build) {
isl_ast_expr *RunCondition;
// The conditions that need to be checked at run-time for this scop are
@@ -392,7 +393,8 @@ static bool benefitsFromPolly(Scop *Scop, bool PerformParallelTest) {
}
IslAst::IslAst(Scop *Scop)
- : S(Scop), Root(nullptr), Build(nullptr), Ctx(Scop->getSharedIslCtx()) {}
+ : S(Scop), Root(nullptr), RunCondition(nullptr),
+ Ctx(Scop->getSharedIslCtx()) {}
void IslAst::init(const Dependences &D) {
bool PerformParallelTest = PollyParallel || DetectParallel ||
@@ -405,6 +407,7 @@ void IslAst::init(const Dependences &D) {
isl_ctx *Ctx = S->getIslCtx();
isl_options_set_ast_build_atomic_upper_bound(Ctx, true);
isl_options_set_ast_build_detect_min_max(Ctx, true);
+ isl_ast_build *Build;
AstBuildUserInfo BuildInfo;
if (UseContext)
@@ -430,7 +433,11 @@ void IslAst::init(const Dependences &D) {
&BuildInfo);
}
+ RunCondition = buildRunCondition(S, Build);
+
Root = isl_ast_build_node_from_schedule(Build, S->getScheduleTree());
+
+ isl_ast_build_free(Build);
}
IslAst *IslAst::create(Scop *Scop, const Dependences &D) {
@@ -441,10 +448,13 @@ IslAst *IslAst::create(Scop *Scop, const Dependences &D) {
IslAst::~IslAst() {
isl_ast_node_free(Root);
- isl_ast_build_free(Build);
+ isl_ast_expr_free(RunCondition);
}
__isl_give isl_ast_node *IslAst::getAst() { return isl_ast_node_copy(Root); }
+__isl_give isl_ast_expr *IslAst::getRunCondition() {
+ return isl_ast_expr_copy(RunCondition);
+}
void IslAstInfo::releaseMemory() {
if (Ast) {
@@ -470,7 +480,7 @@ bool IslAstInfo::runOnScop(Scop &Scop) {
__isl_give isl_ast_node *IslAstInfo::getAst() const { return Ast->getAst(); }
__isl_give isl_ast_expr *IslAstInfo::getRunCondition() const {
- return Ast->buildRunCondition();
+ return Ast->getRunCondition();
}
IslAstUserPayload *IslAstInfo::getNodePayload(__isl_keep isl_ast_node *Node) {
OpenPOWER on IntegriCloud