[llvm-commits] [polly] r153645 - in /polly/trunk: lib/CodeGeneration.cpp test/CodeGen/OpenMP/simple_nested_loop.ll
Tobias Grosser
grosser at fim.uni-passau.de
Thu Mar 29 06:10:26 PDT 2012
Author: grosser
Date: Thu Mar 29 08:10:26 2012
New Revision: 153645
URL: http://llvm.org/viewvc/llvm-project?rev=153645&view=rev
Log:
CodeGeneration: Proberly build the dominator tree
Modified:
polly/trunk/lib/CodeGeneration.cpp
polly/trunk/test/CodeGen/OpenMP/simple_nested_loop.ll
Modified: polly/trunk/lib/CodeGeneration.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGeneration.cpp?rev=153645&r1=153644&r2=153645&view=diff
==============================================================================
--- polly/trunk/lib/CodeGeneration.cpp (original)
+++ polly/trunk/lib/CodeGeneration.cpp Thu Mar 29 08:10:26 2012
@@ -33,6 +33,7 @@
#include "llvm/Module.h"
#include "llvm/ADT/SetVector.h"
+#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/ScalarEvolutionExpander.h"
#include "llvm/Support/CommandLine.h"
@@ -1223,6 +1224,17 @@
}
}
+static void clearDomtree(Function *F, DominatorTree &DT) {
+ DomTreeNode *N = DT.getNode(&F->getEntryBlock());
+ std::vector<BasicBlock*> Nodes;
+ for (po_iterator<DomTreeNode*> I = po_begin(N), E = po_end(N); I != E; ++I)
+ Nodes.push_back(I->getBlock());
+
+ for (std::vector<BasicBlock*>::iterator I = Nodes.begin(), E = Nodes.end();
+ I != E; ++I)
+ DT.eraseNode(*I);
+}
+
void ClastStmtCodeGen::codegenForOpenMP(const clast_for *For) {
Value *Stride, *LB, *UB, *IV;
BasicBlock::iterator LoopBody;
@@ -1251,6 +1263,9 @@
ClastVars.erase(For->iterator);
updateWithValueMap(VMap, /* reverse */ true);
+ clearDomtree((*LoopBody).getParent()->getParent(),
+ P->getAnalysis<DominatorTree>());
+
Builder.SetInsertPoint(AfterLoop);
}
Modified: polly/trunk/test/CodeGen/OpenMP/simple_nested_loop.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/CodeGen/OpenMP/simple_nested_loop.ll?rev=153645&r1=153644&r2=153645&view=diff
==============================================================================
--- polly/trunk/test/CodeGen/OpenMP/simple_nested_loop.ll (original)
+++ polly/trunk/test/CodeGen/OpenMP/simple_nested_loop.ll Thu Mar 29 08:10:26 2012
@@ -1,5 +1,5 @@
; ModuleID = 'simple_nested_loop.s'
-; RUN: opt %loadPolly %defaultOpts -polly-codegen -enable-polly-openmp -S %s | FileCheck %s
+; RUN: opt %loadPolly %defaultOpts -polly-codegen -enable-polly-openmp -verify-dom-info -S %s | FileCheck %s
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32"
target triple = "i386-pc-linux-gnu"
More information about the llvm-commits
mailing list