summaryrefslogtreecommitdiffstats
path: root/stacker
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-02-02 02:16:23 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-02-02 02:16:23 +0000
commit2341c22ec71aed773101eef6bc725df2047e5154 (patch)
tree453d820479bbe83769e54e01abc702ac8ef71312 /stacker
parent48b094d9ddbca690da41f5711d8e1fcb46c50e05 (diff)
downloadbcm5719-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 'stacker')
-rw-r--r--stacker/lib/compiler/StackerCompiler.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/stacker/lib/compiler/StackerCompiler.cpp b/stacker/lib/compiler/StackerCompiler.cpp
index c5c5ab2ae19..844c782c73d 100644
--- a/stacker/lib/compiler/StackerCompiler.cpp
+++ b/stacker/lib/compiler/StackerCompiler.cpp
@@ -1247,7 +1247,8 @@ StackerCompiler::handle_word( int tkn )
LoadInst* op2 = cast<LoadInst>(pop_integer(bb));
CastInst* castop = new TruncInst( op1, Type::Int8Ty );
bb->getInstList().push_back( castop );
- ShiftInst* shlop = new ShiftInst( Instruction::Shl, op2, castop );
+ BinaryOperator* shlop =
+ BinaryOperator::create( Instruction::Shl, op2, castop );
bb->getInstList().push_back( shlop );
push_value( bb, shlop );
break;
@@ -1259,7 +1260,8 @@ StackerCompiler::handle_word( int tkn )
LoadInst* op2 = cast<LoadInst>(pop_integer(bb));
CastInst* castop = new TruncInst( op1, Type::Int8Ty );
bb->getInstList().push_back( castop );
- ShiftInst* shrop = new ShiftInst( Instruction::AShr, op2, castop );
+ BinaryOperator* shrop =
+ BinaryOperator::create( Instruction::AShr, op2, castop );
bb->getInstList().push_back( shrop );
push_value( bb, shrop );
break;
OpenPOWER on IntegriCloud