summaryrefslogtreecommitdiffstats
path: root/polly/lib/CodeGen/PPCGCodeGeneration.cpp
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2016-08-08 17:35:55 +0000
committerTobias Grosser <tobias@grosser.es>2016-08-08 17:35:55 +0000
commitcb1aef8de4abe60c75f154aa9d7100a36064e9c2 (patch)
treeac44dfd2552a7e39812158de80f89aeee78dcf9b /polly/lib/CodeGen/PPCGCodeGeneration.cpp
parentfa9abd1f03c74e172c3de5899b4d889228588225 (diff)
downloadbcm5719-llvm-cb1aef8de4abe60c75f154aa9d7100a36064e9c2.tar.gz
bcm5719-llvm-cb1aef8de4abe60c75f154aa9d7100a36064e9c2.zip
[GPGPU] Create code to verify run-time conditions
llvm-svn: 278026
Diffstat (limited to 'polly/lib/CodeGen/PPCGCodeGeneration.cpp')
-rw-r--r--polly/lib/CodeGen/PPCGCodeGeneration.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
index fa37f097f4c..9d851d1b967 100644
--- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp
+++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
@@ -12,6 +12,7 @@
//
//===----------------------------------------------------------------------===//
+#include "polly/CodeGen/IslAst.h"
#include "polly/CodeGen/IslNodeBuilder.h"
#include "polly/CodeGen/Utils.h"
#include "polly/DependenceInfo.h"
@@ -2038,10 +2039,17 @@ public:
executeScopConditionally(*S, this, Builder.getTrue());
// TODO: Handle LICM
- // TODO: Verify run-time checks
auto SplitBlock = StartBlock->getSinglePredecessor();
Builder.SetInsertPoint(SplitBlock->getTerminator());
NodeBuilder.addParameters(S->getContext());
+
+ isl_ast_build *Build = isl_ast_build_alloc(S->getIslCtx());
+ isl_ast_expr *Condition = IslAst::buildRunCondition(S, Build);
+ isl_ast_build_free(Build);
+
+ Value *RTC = NodeBuilder.createRTC(Condition);
+ Builder.GetInsertBlock()->getTerminator()->setOperand(0, RTC);
+
Builder.SetInsertPoint(&*StartBlock->begin());
NodeBuilder.initializeAfterRTH();
OpenPOWER on IntegriCloud