diff options
Diffstat (limited to 'polly/lib/CodeGen')
-rw-r--r-- | polly/lib/CodeGen/BlockGenerators.cpp | 29 | ||||
-rw-r--r-- | polly/lib/CodeGen/CodeGeneration.cpp | 10 | ||||
-rw-r--r-- | polly/lib/CodeGen/IslCodeGeneration.cpp | 9 |
3 files changed, 8 insertions, 40 deletions
diff --git a/polly/lib/CodeGen/BlockGenerators.cpp b/polly/lib/CodeGen/BlockGenerators.cpp index e483cae5347..4c0762ca69d 100644 --- a/polly/lib/CodeGen/BlockGenerators.cpp +++ b/polly/lib/CodeGen/BlockGenerators.cpp @@ -39,30 +39,17 @@ static cl::opt<bool> Aligned("enable-polly-aligned", cl::Hidden, cl::init(false), cl::ZeroOrMore, cl::cat(PollyCategory)); -static cl::opt<bool, true> - SCEVCodegenF("polly-codegen-scev", - cl::desc("Use SCEV based code generation."), cl::Hidden, - cl::location(SCEVCodegen), cl::init(true), cl::ZeroOrMore, - cl::cat(PollyCategory)); - -bool polly::SCEVCodegen; - bool polly::canSynthesize(const Instruction *I, const llvm::LoopInfo *LI, ScalarEvolution *SE, const Region *R) { - if (SCEVCodegen) { - if (!I || !SE->isSCEVable(I->getType())) - return false; - - if (const SCEV *Scev = SE->getSCEV(const_cast<Instruction *>(I))) - if (!isa<SCEVCouldNotCompute>(Scev)) - if (!hasScalarDepsInsideRegion(Scev, R)) - return true; - + if (!I || !SE->isSCEVable(I->getType())) return false; - } - Loop *L = LI->getLoopFor(I->getParent()); - return L && I == L->getCanonicalInductionVariable() && R->contains(L); + if (const SCEV *Scev = SE->getSCEV(const_cast<Instruction *>(I))) + if (!isa<SCEVCouldNotCompute>(Scev)) + if (!hasScalarDepsInsideRegion(Scev, R)) + return true; + + return false; } BlockGenerator::BlockGenerator(PollyIRBuilder &B, ScopStmt &Stmt, Pass *P, @@ -91,7 +78,7 @@ Value *BlockGenerator::getNewValue(const Value *Old, ValueMapT &BBMap, if (Value *New = BBMap.lookup(Old)) return New; - if (SCEVCodegen && SE.isSCEVable(Old->getType())) + if (SE.isSCEVable(Old->getType())) if (const SCEV *Scev = SE.getSCEVAtScope(const_cast<Value *>(Old), L)) { if (!isa<SCEVCouldNotCompute>(Scev)) { const SCEV *NewScev = apply(Scev, LTS, SE); diff --git a/polly/lib/CodeGen/CodeGeneration.cpp b/polly/lib/CodeGen/CodeGeneration.cpp index d1b1709cafe..91da58c2fec 100644 --- a/polly/lib/CodeGen/CodeGeneration.cpp +++ b/polly/lib/CodeGen/CodeGeneration.cpp @@ -412,16 +412,6 @@ void ClastStmtCodeGen::codegen(const clast_assignment *A, ScopStmt *Stmt, if (VLTS) (*VLTS)[VectorDim][Stmt->getLoopForDimension(Dim)] = URHS; LoopToScev[Stmt->getLoopForDimension(Dim)] = URHS; - - const PHINode *PN = Stmt->getInductionVariableForDimension(Dim); - if (PN) { - RHS = Builder.CreateTruncOrBitCast(RHS, PN->getType()); - - if (VectorVMap) - (*VectorVMap)[VectorDim][PN] = RHS; - - ValueMap[PN] = RHS; - } } void ClastStmtCodeGen::codegenSubstitutions(const clast_stmt *Assignment, diff --git a/polly/lib/CodeGen/IslCodeGeneration.cpp b/polly/lib/CodeGen/IslCodeGeneration.cpp index 5308da3c921..34043782e9b 100644 --- a/polly/lib/CodeGen/IslCodeGeneration.cpp +++ b/polly/lib/CodeGen/IslCodeGeneration.cpp @@ -751,15 +751,6 @@ void IslNodeBuilder::createSubstitutions(isl_ast_expr *Expr, ScopStmt *Stmt, V = ExprBuilder.create(SubExpr); ScalarEvolution *SE = Stmt->getParent()->getSE(); LTS[Stmt->getLoopForDimension(i)] = SE->getUnknown(V); - - // CreateIntCast can introduce trunc expressions. This is correct, as the - // result will always fit into the type of the original induction variable - // (because we calculate a value of the original induction variable). - const Value *OldIV = Stmt->getInductionVariableForDimension(i); - if (OldIV) { - V = Builder.CreateIntCast(V, OldIV->getType(), true); - VMap[OldIV] = V; - } } // Add the current ValueMap to our per-statement value map. |