[polly] r265823 - Collect and verify generated parallel subfunctions
Johannes Doerfert via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 8 11:16:02 PDT 2016
Author: jdoerfert
Date: Fri Apr 8 13:16:02 2016
New Revision: 265823
URL: http://llvm.org/viewvc/llvm-project?rev=265823&view=rev
Log:
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.
Modified:
polly/trunk/include/polly/CodeGen/IslNodeBuilder.h
polly/trunk/lib/CodeGen/CodeGeneration.cpp
polly/trunk/lib/CodeGen/IslNodeBuilder.cpp
Modified: polly/trunk/include/polly/CodeGen/IslNodeBuilder.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/CodeGen/IslNodeBuilder.h?rev=265823&r1=265822&r2=265823&view=diff
==============================================================================
--- polly/trunk/include/polly/CodeGen/IslNodeBuilder.h (original)
+++ polly/trunk/include/polly/CodeGen/IslNodeBuilder.h Fri Apr 8 13:16:02 2016
@@ -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
Modified: polly/trunk/lib/CodeGen/CodeGeneration.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/CodeGeneration.cpp?rev=265823&r1=265822&r2=265823&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/CodeGeneration.cpp (original)
+++ polly/trunk/lib/CodeGen/CodeGeneration.cpp Fri Apr 8 13:16:02 2016
@@ -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).
Modified: polly/trunk/lib/CodeGen/IslNodeBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/IslNodeBuilder.cpp?rev=265823&r1=265822&r2=265823&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/IslNodeBuilder.cpp (original)
+++ polly/trunk/lib/CodeGen/IslNodeBuilder.cpp Fri Apr 8 13:16:02 2016
@@ -622,6 +622,9 @@ void IslNodeBuilder::createForParallel(_
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;
More information about the llvm-commits
mailing list