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

Duncan Sands baldrick at free.fr
Tue Aug 16 23:09:14 PDT 2011


Hi Eli,

> Extend the undef ^ undef idiom once more.  No testcase: I can't figure out how to actually trigger the codepath in question at the moment, but it might get exposed in the future.

if both Op0 and Op1 are undef, then this will have been done already in the
constant folding logic at the start of the function.  So I think this change
is pointless.

Ciao, Duncan.

>
>
> Modified:
>      llvm/trunk/lib/Analysis/InstructionSimplify.cpp
>
> Modified: llvm/trunk/lib/Analysis/InstructionSimplify.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InstructionSimplify.cpp?rev=137781&r1=137780&r2=137781&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Analysis/InstructionSimplify.cpp (original)
> +++ llvm/trunk/lib/Analysis/InstructionSimplify.cpp Tue Aug 16 17:38:34 2011
> @@ -1348,6 +1348,11 @@
>       std::swap(Op0, Op1);
>     }
>
> +  // A ^ A = 0
> +  // Do this first so that we catch the undef ^ undef "idiom".
> +  if (Op0 == Op1)
> +    return Constant::getNullValue(Op0->getType());
> +
>     // A ^ undef ->  undef
>     if (match(Op1, m_Undef()))
>       return Op1;
> @@ -1356,10 +1361,6 @@
>     if (match(Op1, m_Zero()))
>       return Op0;
>
> -  // A ^ A = 0
> -  if (Op0 == Op1)
> -    return Constant::getNullValue(Op0->getType());
> -
>     // A ^ ~A  =  ~A ^ A  =  -1
>     if (match(Op0, m_Not(m_Specific(Op1))) ||
>         match(Op1, m_Not(m_Specific(Op0))))
>
>
> _______________________________________________
> 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