[llvm-commits] CVS: llvm/include/llvm/Analysis/ScalarEvolutionExpander.h
Reid Spencer
reid at x10sys.com
Sun Dec 3 18:45:12 PST 2006
Changes in directory llvm/include/llvm/Analysis:
ScalarEvolutionExpander.h updated: 1.7 -> 1.8
---
Log message:
Change inferred casts to explicit casts.
---
Diffs of the changes: (+8 -2)
ScalarEvolutionExpander.h | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
Index: llvm/include/llvm/Analysis/ScalarEvolutionExpander.h
diff -u llvm/include/llvm/Analysis/ScalarEvolutionExpander.h:1.7 llvm/include/llvm/Analysis/ScalarEvolutionExpander.h:1.8
--- llvm/include/llvm/Analysis/ScalarEvolutionExpander.h:1.7 Sun Nov 26 19:05:09 2006
+++ llvm/include/llvm/Analysis/ScalarEvolutionExpander.h Sun Dec 3 20:44:57 2006
@@ -115,12 +115,18 @@
Value *visitTruncateExpr(SCEVTruncateExpr *S) {
Value *V = expand(S->getOperand());
- return CastInst::createInferredCast(V, S->getType(), "tmp.", InsertPt);
+ Instruction::CastOps Opcode = (V->getType()->getPrimitiveSizeInBits() ==
+ S->getType()->getPrimitiveSizeInBits()) ? Instruction::BitCast :
+ Instruction::Trunc;
+ return CastInst::create(Opcode, V, S->getType(), "tmp.", InsertPt);
}
Value *visitZeroExtendExpr(SCEVZeroExtendExpr *S) {
Value *V = expandInTy(S->getOperand(),S->getType()->getUnsignedVersion());
- return CastInst::createInferredCast(V, S->getType(), "tmp.", InsertPt);
+ Instruction::CastOps Opcode = (V->getType()->getPrimitiveSizeInBits() ==
+ S->getType()->getPrimitiveSizeInBits()) ? Instruction::BitCast :
+ Instruction::ZExt;
+ return CastInst::create(Opcode, V, S->getType(), "tmp.", InsertPt);
}
Value *visitAddExpr(SCEVAddExpr *S) {
More information about the llvm-commits
mailing list