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

Reid Spencer rspencer at reidspencer.com
Wed Dec 13 10:05:44 PST 2006


On Wed, 2006-12-13 at 09:53 -0800, Chris Lattner wrote:
> > Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
> > diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.567  
> > llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.568
> > --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.567	Wed  
> > Dec 13 02:27:15 2006
> > +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp	Wed Dec 13  
> > 02:33:33 2006
> > @@ -2172,11 +2172,13 @@
> >    // formed.
> >    CastInst *BoolCast = 0;
> >    if (CastInst *CI = dyn_cast<CastInst>(I.getOperand(0)))
> > -    if (CI->getOperand(0)->getType() == Type::BoolTy)
> > +    if (CI->getOperand(0)->getType() == Type::BoolTy &&
> > +        CI->getOpcode() == Instruction::ZExt)
> >        BoolCast = CI;
> >    if (!BoolCast)
> >      if (CastInst *CI = dyn_cast<CastInst>(I.getOperand(1)))
> > -      if (CI->getOperand(0)->getType() == Type::BoolTy)
> > +      if (CI->getOperand(0)->getType() == Type::BoolTy &&
> > +        CI->getOpcode() == Instruction::ZExt)
> >          BoolCast = CI;
> >    if (BoolCast) {
> >      if (SetCondInst *SCI = dyn_cast<SetCondInst>(BoolCast- 
> > >getOperand(0))) {
> 
> Why not dyn_cast<ZExtInst> instead of checking the opcode?

Because at midnight I'm not thinking clearly?

I've included this in my next round of tests.

> 
> Thanks Reid,
> 
> -Chris
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list