From 2341c22ec71aed773101eef6bc725df2047e5154 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Fri, 2 Feb 2007 02:16:23 +0000 Subject: 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 --- stacker/lib/compiler/StackerCompiler.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'stacker') 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(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(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; -- cgit v1.2.3