[llvm-commits] [llvm] r150694 - /llvm/trunk/lib/Analysis/InstructionSimplify.cpp

Duncan Sands baldrick at free.fr
Thu Feb 16 07:21:49 PST 2012


Hi Benjamin,

> --- llvm/trunk/lib/Analysis/InstructionSimplify.cpp (original)
> +++ llvm/trunk/lib/Analysis/InstructionSimplify.cpp Thu Feb 16 09:03:04 2012
> @@ -1542,6 +1542,10 @@
>     Type *ITy = GetCompareTy(LHS); // The return type.
>     Type *OpTy = LHS->getType();   // The operand type.
>
> +  // Remove pointer casts that don't change the value.
> +  LHS = LHS->stripPointerCasts();
> +  RHS = RHS->stripPointerCasts();

unfortunately it does change the type, which means that the routine has to be
carefully audited to be sure that that doesn't matter.  Sorry I didn't think
of this earlier.

Ciao, Duncan.



More information about the llvm-commits mailing list