[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp

Reid Spencer rspencer at reidspencer.com
Wed Dec 13 10:06:29 PST 2006


On Wed, 2006-12-13 at 09:51 -0800, Chris Lattner wrote:
> > Implement review feedback. Most of this has to do with removing  
> > unnecessary
> > cast instructions. A few are bug fixes.
> 
> Thanks Reid,
> 
> > @@ -4342,9 +4333,8 @@
> >            // Check to see if there is a noop-cast between the  
> > shift and the and.
> >            if (!Shift) {
> >              if (CastInst *CI = dyn_cast<CastInst>(LHSI->getOperand 
> > (0)))
> > -              if (CI->getOperand(0)->getType()->isIntegral() &&
> > -                  CI->getOperand(0)->getType()- 
> > >getPrimitiveSizeInBits() ==
> > -                     CI->getType()->getPrimitiveSizeInBits())
> > +              if (CI->getOpcode() == Instruction::BitCast &&
> > +                  CI->getType()->isIntegral())
> >                  Shift = dyn_cast<ShiftInst>(CI->getOperand(0));
> >            }
> 
> I'm pretty certain you can also drop the 'CI->getType()->isIntegral 
> ()' check here.  Shifts can only return/take integral arguments.

Yup, dropped it.

> 
> -Chris




More information about the llvm-commits mailing list