forked from OSchip/llvm-project
Collect and verify generated parallel subfunctions
We verify the optimized function now for a long time and it helped to track down bugs early. This will now also happen for all parallel subfunctions we generate. llvm-svn: 265823
This commit is contained in:
parent
efe3732883
commit
a9dc529442
|
@ -58,6 +58,11 @@ public:
|
|||
/// @return A referecne to the associated block generator.
|
||||
BlockGenerator &getBlockGenerator() { return BlockGen; }
|
||||
|
||||
/// @brief Return the parallel subfunctions that have been created.
|
||||
const ArrayRef<Function *> getParallelSubfunctions() const {
|
||||
return ParallelSubfunctions;
|
||||
}
|
||||
|
||||
protected:
|
||||
Scop &S;
|
||||
PollyIRBuilder &Builder;
|
||||
|
@ -103,6 +108,9 @@ protected:
|
|||
// ivs.
|
||||
IslExprBuilder::IDToValueTy IDToValue;
|
||||
|
||||
/// @brief A collection of all parallel subfunctions that have been created.
|
||||
SmallVector<Function *, 8> ParallelSubfunctions;
|
||||
|
||||
/// Generate code for a given SCEV*
|
||||
///
|
||||
/// This function generates code for a given SCEV expression. It generated
|
||||
|
|
|
@ -202,6 +202,8 @@ public:
|
|||
}
|
||||
|
||||
verifyGeneratedFunction(S, *EnteringBB->getParent());
|
||||
for (auto *SubF : NodeBuilder.getParallelSubfunctions())
|
||||
verifyGeneratedFunction(S, *SubF);
|
||||
|
||||
// Mark the function such that we run additional cleanup passes on this
|
||||
// function (e.g. mem2reg to rediscover phi nodes).
|
||||
|
|
|
@ -622,6 +622,9 @@ void IslNodeBuilder::createForParallel(__isl_take isl_ast_node *For) {
|
|||
BasicBlock::iterator AfterLoop = Builder.GetInsertPoint();
|
||||
Builder.SetInsertPoint(&*LoopBody);
|
||||
|
||||
// Remember the parallel subfunction
|
||||
ParallelSubfunctions.push_back(LoopBody->getFunction());
|
||||
|
||||
// Save the current values.
|
||||
auto ValueMapCopy = ValueMap;
|
||||
IslExprBuilder::IDToValueTy IDToValueCopy = IDToValue;
|
||||
|
|
Loading…
Reference in New Issue