From f8a678d2fdc280b46c7be0422f84abafc345b842 Mon Sep 17 00:00:00 2001 From: Tobias Grosser Date: Sun, 28 Sep 2014 22:40:36 +0000 Subject: [PATCH] Build domtree of new loops correctly This fixes a bug introduced in r217525. llvm-svn: 218581 --- polly/lib/CodeGen/LoopGenerators.cpp | 2 +- polly/test/Isl/CodeGen/no_guard_bb.ll | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/polly/lib/CodeGen/LoopGenerators.cpp b/polly/lib/CodeGen/LoopGenerators.cpp index 267caeb5001b..ef9bda58fd59 100644 --- a/polly/lib/CodeGen/LoopGenerators.cpp +++ b/polly/lib/CodeGen/LoopGenerators.cpp @@ -127,7 +127,7 @@ Value *polly::createLoop(Value *LB, Value *UB, Value *Stride, if (GuardBB) DT.changeImmediateDominator(ExitBB, GuardBB); else - DT.changeImmediateDominator(ExitBB, BeforeBB); + DT.changeImmediateDominator(ExitBB, HeaderBB); // The loop body should be added here. Builder.SetInsertPoint(HeaderBB->getFirstNonPHI()); diff --git a/polly/test/Isl/CodeGen/no_guard_bb.ll b/polly/test/Isl/CodeGen/no_guard_bb.ll index 3b51c77a95f9..b5bf88bc19fc 100644 --- a/polly/test/Isl/CodeGen/no_guard_bb.ll +++ b/polly/test/Isl/CodeGen/no_guard_bb.ll @@ -1,4 +1,4 @@ -; RUN: opt %loadPolly -polly-codegen-isl -S < %s | FileCheck %s +; RUN: opt %loadPolly -polly-codegen-isl -S -verify-dom-info < %s | FileCheck %s ; ; CHECK-NOT: br i1 true, label %polly.{{.*}}, label %polly.{{.*}} ;