[polly] r222766 - Add PreHeader always to OuterLoop

Tobias Grosser tobias at grosser.es
Tue Nov 25 09:09:21 PST 2014


Author: grosser
Date: Tue Nov 25 11:09:21 2014
New Revision: 222766

URL: http://llvm.org/viewvc/llvm-project?rev=222766&view=rev
Log:
Add PreHeader always to OuterLoop

This fixes a bug introduce in r217525.

Modified:
    polly/trunk/lib/CodeGen/LoopGenerators.cpp
    polly/trunk/test/Isl/CodeGen/test-invalid-operands-for-select-2.ll

Modified: polly/trunk/lib/CodeGen/LoopGenerators.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/LoopGenerators.cpp?rev=222766&r1=222765&r2=222766&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/LoopGenerators.cpp (original)
+++ polly/trunk/lib/CodeGen/LoopGenerators.cpp Tue Nov 25 11:09:21 2014
@@ -78,10 +78,11 @@ Value *polly::createLoop(Value *LB, Valu
   else
     LI.addTopLevelLoop(NewLoop);
 
-  if (OuterLoop && GuardBB)
-    OuterLoop->addBasicBlockToLoop(GuardBB, LI.getBase());
-  else if (OuterLoop)
+  if (OuterLoop) {
+    if (GuardBB)
+      OuterLoop->addBasicBlockToLoop(GuardBB, LI.getBase());
     OuterLoop->addBasicBlockToLoop(PreHeaderBB, LI.getBase());
+  }
 
   NewLoop->addBasicBlockToLoop(HeaderBB, LI.getBase());
 

Modified: polly/trunk/test/Isl/CodeGen/test-invalid-operands-for-select-2.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/CodeGen/test-invalid-operands-for-select-2.ll?rev=222766&r1=222765&r2=222766&view=diff
==============================================================================
--- polly/trunk/test/Isl/CodeGen/test-invalid-operands-for-select-2.ll (original)
+++ polly/trunk/test/Isl/CodeGen/test-invalid-operands-for-select-2.ll Tue Nov 25 11:09:21 2014
@@ -1,4 +1,4 @@
-; RUN: opt %loadPolly -S -polly-code-generator=isl -polly-codegen-isl < %s | FileCheck %s
+; RUN: opt %loadPolly -S -polly-code-generator=isl -polly-codegen-isl -verify-loop-info < %s | FileCheck %s
 ;
 ; Check that we do not crash as described here: http://llvm.org/bugs/show_bug.cgi?id=21167
 ;





More information about the llvm-commits mailing list