[LLVMdev] ConstantFold 'undef xor undef'

Chris Lattner
Wed, 07 Jul 2010 15:49:58 -0000

On Jul 7, 2010, at 8:45 AM, Jianzhou Zhao wrote:

>>
>> I don't really understand your question here.  Are you asking about
C or LLVM IR, or something else?
>
> Sorry for the confusion. Does ConstantFoldBinaryInstruction also fold
> x ^ y into 0 if both x and y are undef?

That's a poorly formed question.  ConstantFoldBinaryInstruction doesn't
do any real analysis - if there is a symbolic operand, it doesn't do the
fold.  It only folds when the two operands *are* undef.  It has no idea if they
came from the "same" variable or not.

-Chris