diff options
| author | Reid Spencer <rspencer@reidspencer.com> | 2007-02-02 02:16:23 +0000 |
|---|---|---|
| committer | Reid Spencer <rspencer@reidspencer.com> | 2007-02-02 02:16:23 +0000 |
| commit | 2341c22ec71aed773101eef6bc725df2047e5154 (patch) | |
| tree | 453d820479bbe83769e54e01abc702ac8ef71312 /llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp | |
| parent | 48b094d9ddbca690da41f5711d8e1fcb46c50e05 (diff) | |
| download | bcm5719-llvm-2341c22ec71aed773101eef6bc725df2047e5154.tar.gz bcm5719-llvm-2341c22ec71aed773101eef6bc725df2047e5154.zip | |
Changes to support making the shift instructions be true BinaryOperators.
This feature is needed in order to support shifts of more than 255 bits
on large integer types. This changes the syntax for llvm assembly to
make shl, ashr and lshr instructions look like a binary operator:
shl i32 %X, 1
instead of
shl i32 %X, i8 1
Additionally, this should help a few passes perform additional optimizations.
llvm-svn: 33776
Diffstat (limited to 'llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp index e307ea70086..a7f33c9b195 100644 --- a/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp +++ b/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp @@ -655,9 +655,9 @@ void SROA::ConvertUsesToScalar(Value *Ptr, AllocaInst *NewAI, unsigned Offset) { } else { assert(NV->getType()->isInteger() && "Unknown promotion!"); if (Offset && Offset < TD.getTypeSize(NV->getType())*8) { - NV = new ShiftInst(Instruction::LShr, NV, - ConstantInt::get(Type::Int8Ty, Offset), - LI->getName(), LI); + NV = BinaryOperator::create(Instruction::LShr, NV, + ConstantInt::get(NV->getType(), Offset), + LI->getName(), LI); } // If the result is an integer, this is a trunc or bitcast. @@ -740,9 +740,9 @@ void SROA::ConvertUsesToScalar(Value *Ptr, AllocaInst *NewAI, unsigned Offset) { SV = CastInst::createZExtOrBitCast(SV, AllocaType, SV->getName(), SI); if (Offset && Offset < AllocaType->getPrimitiveSizeInBits()) - SV = new ShiftInst(Instruction::Shl, SV, - ConstantInt::get(Type::Int8Ty, Offset), - SV->getName()+".adj", SI); + SV = BinaryOperator::create(Instruction::Shl, SV, + ConstantInt::get(SV->getType(), Offset), + SV->getName()+".adj", SI); // Mask out the bits we are about to insert from the old value. unsigned TotalBits = TD.getTypeSize(SV->getType())*8; if (TotalBits != SrcSize) { |

