[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
Chris Lattner
clattner at apple.com
Wed Dec 13 09:51:12 PST 2006
> 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.
-Chris
More information about the llvm-commits
mailing list