From acf80064716710a6546282066f4ddd1eeb911f04 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Wed, 2 Nov 2016 22:32:23 +0000 Subject: [Polly CodeGen] Break critical edge from RTC to original loop. This makes polly generate a CFG which is closer to what we want in LLVM IR, with a loop preheader for the original loop. This is just a cleanup, but it exposes some fragile assumptions. I'm not completely happy with the changes related to expandCodeFor; RTCBB->getTerminator() is basically a random insertion point which happens to work due to the way we generate runtime checks. I'm not sure what the right answer looks like, though. Differential Revision: https://reviews.llvm.org/D26053 llvm-svn: 285864 --- polly/lib/CodeGen/IslNodeBuilder.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'polly/lib/CodeGen/IslNodeBuilder.cpp') diff --git a/polly/lib/CodeGen/IslNodeBuilder.cpp b/polly/lib/CodeGen/IslNodeBuilder.cpp index 0869a7fc86b..5c50fbf0e88 100644 --- a/polly/lib/CodeGen/IslNodeBuilder.cpp +++ b/polly/lib/CodeGen/IslNodeBuilder.cpp @@ -1286,7 +1286,8 @@ Value *IslNodeBuilder::generateSCEV(const SCEV *Expr) { "Insert location points after last valid instruction"); Instruction *InsertLocation = &*Builder.GetInsertPoint(); return expandCodeFor(S, SE, DL, "polly", Expr, Expr->getType(), - InsertLocation, &ValueMap); + InsertLocation, &ValueMap, + StartBlock->getSinglePredecessor()); } /// The AST expression we generate to perform the run-time check assumes -- cgit v1.2.3