diff options
author | Tobias Grosser <grosser@fim.uni-passau.de> | 2012-04-03 12:24:32 +0000 |
---|---|---|
committer | Tobias Grosser <grosser@fim.uni-passau.de> | 2012-04-03 12:24:32 +0000 |
commit | 0905a23806a16f491305fb1a3a32e011b96aa73d (patch) | |
tree | 57e8a54ebc50f65f261709999cd9febefc38a7b2 /polly/lib/CodeGen/CodeGeneration.cpp | |
parent | e2cf6743102a171edff2ad88fee47239b065bd8f (diff) | |
download | bcm5719-llvm-0905a23806a16f491305fb1a3a32e011b96aa73d.tar.gz bcm5719-llvm-0905a23806a16f491305fb1a3a32e011b96aa73d.zip |
CodeGen: Recreate old ivs with the original type
To avoid overflows we still use a larger type (i64) while calculating the value
of the old ivs. However, we truncate the result to the type of the old iv when
providing it to the new code.
A corresponding test case is added to the polly test suite. Also, a failing test
case is fixed.
This fixes PR12311.
Contributed by: Tsingray Liu <tsingrayliu@gmail.com>
llvm-svn: 153952
Diffstat (limited to 'polly/lib/CodeGen/CodeGeneration.cpp')
-rw-r--r-- | polly/lib/CodeGen/CodeGeneration.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/polly/lib/CodeGen/CodeGeneration.cpp b/polly/lib/CodeGen/CodeGeneration.cpp index 3a0e7f0ee11..955c13694e1 100644 --- a/polly/lib/CodeGen/CodeGeneration.cpp +++ b/polly/lib/CodeGen/CodeGeneration.cpp @@ -1088,8 +1088,9 @@ void ClastStmtCodeGen::codegen(const clast_assignment *A, ScopStmt *Stmt, assert(!A->LHS && "Statement assignments do not have left hand side"); - RHS = ExpGen.codegen(A->RHS, getIntPtrTy()); PN = Stmt->getInductionVariableForDimension(Dim); + RHS = ExpGen.codegen(A->RHS, Builder.getInt64Ty()); + RHS = Builder.CreateTruncOrBitCast(RHS, PN->getType()); if (VectorVMap) (*VectorVMap)[VectorDim][PN] = RHS; |