summaryrefslogtreecommitdiffstats
path: root/polly/lib/CodeGen/CodeGeneration.cpp
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2016-08-08 15:41:52 +0000
committerTobias Grosser <tobias@grosser.es>2016-08-08 15:41:52 +0000
commit0aa29532b7a439f047c1573548b6458d00a2df54 (patch)
tree515ef53b40c5dc4d7b07779301545832589e94e5 /polly/lib/CodeGen/CodeGeneration.cpp
parent218c4cbd3d7c72e71bc1c33f16d0a30c9abaa7b6 (diff)
downloadbcm5719-llvm-0aa29532b7a439f047c1573548b6458d00a2df54.tar.gz
bcm5719-llvm-0aa29532b7a439f047c1573548b6458d00a2df54.zip
[IslNodeBuilder] Move run-time check generation to NodeBuilder [NFC]
This improves the structure of the code and allows us to reuse the runtime code generation in the PPCGCodeGeneration. llvm-svn: 278017
Diffstat (limited to 'polly/lib/CodeGen/CodeGeneration.cpp')
-rw-r--r--polly/lib/CodeGen/CodeGeneration.cpp23
1 files changed, 1 insertions, 22 deletions
diff --git a/polly/lib/CodeGen/CodeGeneration.cpp b/polly/lib/CodeGen/CodeGeneration.cpp
index b13118c57d0..9fd1df70807 100644
--- a/polly/lib/CodeGen/CodeGeneration.cpp
+++ b/polly/lib/CodeGen/CodeGeneration.cpp
@@ -66,19 +66,6 @@ public:
RegionInfo *RI;
///}
- /// @brief Build the runtime condition.
- ///
- /// Build the condition that evaluates at run-time to true iff all
- /// assumptions taken for the SCoP hold, and to false otherwise.
- ///
- /// @return A value evaluating to true/false if execution is save/unsafe.
- Value *buildRTC(PollyIRBuilder &Builder, IslExprBuilder &ExprBuilder) {
- Value *RTC = ExprBuilder.create(AI->getRunCondition());
- if (!RTC->getType()->isIntegerTy(1))
- RTC = Builder.CreateIsNotNull(RTC);
- return RTC;
- }
-
void verifyGeneratedFunction(Scop &S, Function &F) {
if (!verifyFunction(F, &errs()) || !Verify)
return;
@@ -147,7 +134,6 @@ public:
PollyIRBuilder Builder = createPollyIRBuilder(EnteringBB, Annotator);
IslNodeBuilder NodeBuilder(Builder, Annotator, this, *DL, *LI, *SE, *DT, S);
- IslExprBuilder &ExprBuilder = NodeBuilder.getExprBuilder();
// Only build the run-time condition and parameters _after_ having
// introduced the conditional branch. This is important as the conditional
@@ -189,15 +175,8 @@ public:
isl_ast_node_free(AstRoot);
} else {
NodeBuilder.allocateNewArrays();
-
NodeBuilder.addParameters(S.getContext());
-
- ExprBuilder.setTrackOverflow(true);
- Value *RTC = buildRTC(Builder, ExprBuilder);
- Value *OverflowHappened = Builder.CreateNot(
- ExprBuilder.getOverflowState(), "polly.rtc.overflown");
- RTC = Builder.CreateAnd(RTC, OverflowHappened, "polly.rtc.result");
- ExprBuilder.setTrackOverflow(false);
+ Value *RTC = NodeBuilder.createRTC(AI->getRunCondition());
Builder.GetInsertBlock()->getTerminator()->setOperand(0, RTC);
Builder.SetInsertPoint(&StartBlock->front());
OpenPOWER on IntegriCloud