[polly] r227092 - [FIX] Debug build + instrinsic handling
Johannes Doerfert
doerfert at cs.uni-saarland.de
Mon Jan 26 07:55:55 PST 2015
Author: jdoerfert
Date: Mon Jan 26 09:55:54 2015
New Revision: 227092
URL: http://llvm.org/viewvc/llvm-project?rev=227092&view=rev
Log:
[FIX] Debug build + instrinsic handling
The ignored intrinsics needed to be ignored in three other places as
well. Tests and lnt pass now.
Modified:
polly/trunk/include/polly/CodeGen/BlockGenerators.h
polly/trunk/lib/Analysis/TempScopInfo.cpp
polly/trunk/lib/CodeGen/BlockGenerators.cpp
polly/trunk/lib/Transform/IndependentBlocks.cpp
Modified: polly/trunk/include/polly/CodeGen/BlockGenerators.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/CodeGen/BlockGenerators.h?rev=227092&r1=227091&r2=227092&view=diff
==============================================================================
--- polly/trunk/include/polly/CodeGen/BlockGenerators.h (original)
+++ polly/trunk/include/polly/CodeGen/BlockGenerators.h Mon Jan 26 09:55:54 2015
@@ -58,6 +58,9 @@ typedef std::vector<ValueMapT> VectorVal
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().
Modified: polly/trunk/lib/Analysis/TempScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/TempScopInfo.cpp?rev=227092&r1=227091&r2=227092&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/TempScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/TempScopInfo.cpp Mon Jan 26 09:55:54 2015
@@ -103,6 +103,8 @@ bool TempScopInfo::buildScalarDependence
// 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();
Modified: polly/trunk/lib/CodeGen/BlockGenerators.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/BlockGenerators.cpp?rev=227092&r1=227091&r2=227092&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/BlockGenerators.cpp (original)
+++ polly/trunk/lib/CodeGen/BlockGenerators.cpp Mon Jan 26 09:55:54 2015
@@ -52,6 +52,30 @@ bool polly::canSynthesize(const Instruct
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,
Modified: polly/trunk/lib/Transform/IndependentBlocks.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Transform/IndependentBlocks.cpp?rev=227092&r1=227091&r2=227092&view=diff
==============================================================================
--- polly/trunk/lib/Transform/IndependentBlocks.cpp (original)
+++ polly/trunk/lib/Transform/IndependentBlocks.cpp Mon Jan 26 09:55:54 2015
@@ -130,7 +130,6 @@ struct IndependentBlocks : public Functi
// 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 Functi
};
}
-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::isIndependentBlo
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::isIndependentBlo
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);
More information about the llvm-commits
mailing list