[llvm-commits] CVS: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp
Chris Lattner
sabre at nondot.org
Mon Oct 23 23:26:46 PDT 2006
Changes in directory llvm/lib/Transforms/Scalar:
ScalarReplAggregates.cpp updated: 1.45 -> 1.46
---
Log message:
Fix Transforms/ScalarRepl/2006-10-23-PointerUnionCrash.ll
---
Diffs of the changes: (+10 -5)
ScalarReplAggregates.cpp | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
Index: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp
diff -u llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.45 llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.46
--- llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.45 Fri Oct 20 02:07:24 2006
+++ llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp Tue Oct 24 01:26:32 2006
@@ -611,11 +611,16 @@
NV = new ExtractElementInst(NV, ConstantInt::get(Type::UIntTy, Elt),
"tmp", LI);
} else {
- assert(NV->getType()->isInteger() && "Unknown promotion!");
- if (Offset && Offset < TD.getTypeSize(NV->getType())*8)
- NV = new ShiftInst(Instruction::Shr, NV,
- ConstantInt::get(Type::UByteTy, Offset),
- LI->getName(), LI);
+ if (Offset) {
+ assert(NV->getType()->isInteger() && "Unknown promotion!");
+ if (Offset < TD.getTypeSize(NV->getType())*8)
+ NV = new ShiftInst(Instruction::Shr, NV,
+ ConstantInt::get(Type::UByteTy, Offset),
+ LI->getName(), LI);
+ } else {
+ assert((NV->getType()->isInteger() ||
+ isa<PointerType>(NV->getType())) && "Unknown promotion!");
+ }
NV = new CastInst(NV, LI->getType(), LI->getName(), LI);
}
}
More information about the llvm-commits
mailing list