summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Doerfert <doerfert@cs.uni-saarland.de>2015-01-26 15:55:54 +0000
committerJohannes Doerfert <doerfert@cs.uni-saarland.de>2015-01-26 15:55:54 +0000
commit9e3a5db00079bf09c82f091206453f85c055461d (patch)
treed17431c9ca4137314cdb629ece1d5c2de8596382
parent89814b476216f48df51147bf89ec7d4b34448a2e (diff)
downloadbcm5719-llvm-9e3a5db00079bf09c82f091206453f85c055461d.tar.gz
bcm5719-llvm-9e3a5db00079bf09c82f091206453f85c055461d.zip
[FIX] Debug build + instrinsic handling
The ignored intrinsics needed to be ignored in three other places as well. Tests and lnt pass now. llvm-svn: 227092
-rw-r--r--polly/include/polly/CodeGen/BlockGenerators.h3
-rw-r--r--polly/lib/Analysis/TempScopInfo.cpp2
-rw-r--r--polly/lib/CodeGen/BlockGenerators.cpp24
-rw-r--r--polly/lib/Transform/IndependentBlocks.cpp29
4 files changed, 33 insertions, 25 deletions
diff --git a/polly/include/polly/CodeGen/BlockGenerators.h b/polly/include/polly/CodeGen/BlockGenerators.h
index cb56898d2c2..79d42c58042 100644
--- a/polly/include/polly/CodeGen/BlockGenerators.h
+++ b/polly/include/polly/CodeGen/BlockGenerators.h
@@ -58,6 +58,9 @@ typedef std::vector<ValueMapT> VectorValueMapT;
bool canSynthesize(const llvm::Instruction *I, const llvm::LoopInfo *LI,
llvm::ScalarEvolution *SE, const llvm::Region *R);
+/// @brief Return true iff @p V is an intrisic we ignore during code generation.
+bool isIgnoredIntrinsic(const llvm::Value *V);
+
/// @brief Generate a new basic block for a polyhedral statement.
///
/// The only public function exposed is generate().
diff --git a/polly/lib/Analysis/TempScopInfo.cpp b/polly/lib/Analysis/TempScopInfo.cpp
index 09f6dd2137f..53111485bf4 100644
--- a/polly/lib/Analysis/TempScopInfo.cpp
+++ b/polly/lib/Analysis/TempScopInfo.cpp
@@ -103,6 +103,8 @@ bool TempScopInfo::buildScalarDependences(Instruction *Inst, Region *R) {
// synthesizable scalars can be generated by the code generator.
if (canSynthesize(Inst, LI, SE, R))
return false;
+ if (isIgnoredIntrinsic(Inst))
+ return false;
bool AnyCrossStmtUse = false;
BasicBlock *ParentBB = Inst->getParent();
diff --git a/polly/lib/CodeGen/BlockGenerators.cpp b/polly/lib/CodeGen/BlockGenerators.cpp
index 626626f51eb..d7ccea69c7c 100644
--- a/polly/lib/CodeGen/BlockGenerators.cpp
+++ b/polly/lib/CodeGen/BlockGenerators.cpp
@@ -52,6 +52,30 @@ bool polly::canSynthesize(const Instruction *I, const llvm::LoopInfo *LI,
return false;
}
+bool polly::isIgnoredIntrinsic(const Value *V) {
+ if (auto *IT = dyn_cast<IntrinsicInst>(V)) {
+ switch (IT->getIntrinsicID()) {
+ // Lifetime markers are supported/ignored.
+ case llvm::Intrinsic::lifetime_start:
+ case llvm::Intrinsic::lifetime_end:
+ // Invariant markers are supported/ignored.
+ case llvm::Intrinsic::invariant_start:
+ case llvm::Intrinsic::invariant_end:
+ // Some misc annotations are supported/ignored.
+ case llvm::Intrinsic::var_annotation:
+ case llvm::Intrinsic::ptr_annotation:
+ case llvm::Intrinsic::annotation:
+ case llvm::Intrinsic::donothing:
+ case llvm::Intrinsic::assume:
+ case llvm::Intrinsic::expect:
+ return true;
+ default:
+ break;
+ }
+ }
+ return false;
+}
+
BlockGenerator::BlockGenerator(PollyIRBuilder &B, ScopStmt &Stmt, Pass *P,
LoopInfo &LI, ScalarEvolution &SE,
isl_ast_build *Build,
diff --git a/polly/lib/Transform/IndependentBlocks.cpp b/polly/lib/Transform/IndependentBlocks.cpp
index 85f906d1324..72f9661bcf4 100644
--- a/polly/lib/Transform/IndependentBlocks.cpp
+++ b/polly/lib/Transform/IndependentBlocks.cpp
@@ -130,7 +130,6 @@ struct IndependentBlocks : public FunctionPass {
// Split the exit block to hold load instructions.
bool splitExitBlock(Region *R);
- bool isIgnoredIntrinsic(Instruction *Inst);
bool onlyUsedInRegion(Instruction *Inst, const Region *R);
bool translateScalarToArray(BasicBlock *BB, const Region *R);
bool translateScalarToArray(Instruction *Inst, const Region *R);
@@ -143,30 +142,6 @@ struct IndependentBlocks : public FunctionPass {
};
}
-bool IndependentBlocks::isIgnoredIntrinsic(Instruction *Inst) {
- if (auto *IT = dyn_cast<IntrinsicInst>(Inst)) {
- switch (IT->getIntrinsicID()) {
- // Lifetime markers are supported/ignored.
- case llvm::Intrinsic::lifetime_start:
- case llvm::Intrinsic::lifetime_end:
- // Invariant markers are supported/ignored.
- case llvm::Intrinsic::invariant_start:
- case llvm::Intrinsic::invariant_end:
- // Some misc annotations are supported/ignored.
- case llvm::Intrinsic::var_annotation:
- case llvm::Intrinsic::ptr_annotation:
- case llvm::Intrinsic::annotation:
- case llvm::Intrinsic::donothing:
- case llvm::Intrinsic::assume:
- case llvm::Intrinsic::expect:
- return true;
- default:
- break;
- }
- }
- return false;
-}
-
bool IndependentBlocks::isSafeToMove(Instruction *Inst) {
if (Inst->mayReadFromMemory() || Inst->mayWriteToMemory())
return false;
@@ -477,6 +452,8 @@ bool IndependentBlocks::isIndependentBlock(const Region *R,
for (Instruction &Inst : *BB) {
if (canSynthesize(&Inst, LI, SE, R))
continue;
+ if (isIgnoredIntrinsic(&Inst))
+ continue;
// A value inside the Scop is referenced outside.
for (User *U : Inst.users()) {
@@ -493,6 +470,8 @@ bool IndependentBlocks::isIndependentBlock(const Region *R,
continue;
for (Value *Op : Inst.operands()) {
+ if (isIgnoredIntrinsic(Op))
+ continue;
if (isEscapeOperand(Op, BB, R)) {
DEBUG(dbgs() << "Instruction in function '";
BB->getParent()->printAsOperand(dbgs(), false);
OpenPOWER on IntegriCloud