Use the following equality: (x xor y) xor y == x.
With this in mind (a xor b) xor c can be replaced by:
a - if b and c are the same
b - if a and c are the same
c - if a and b are the same
rdar://20280322
Swift SVN r26568
This is just good to do and hopefully will help prevent people from forgetting
to check in the future by annotating the API explicitly as returning a
potentially nullptr.
Swift SVN r25364
ThinFunctionToPointerInst and PointerToThinFunctionInst.
(thin_function_to_pointer (pointer_to_thin_function x)) -> x
(pointer_to_thin_function (thin_function_pointer x)) -> x
Fixes <rdar://problem/19285047>
Swift SVN r24652
When simplifying an 'enum' instruction that appears in a block that is
the destination of a switch_enum, we need to ensure that the block with
the 'enum' instruction is uniquely chosen based on the same enum tag
that the 'enum' instruction uses, not just that we'll reach that
destination block with the same enum tag (since we could have multiple
tags target the same block, and could have a default case).
Fixes rdar://problem/18330952.
Swift SVN r22065
This will hopefully make it clearer as we onboard people that
SimplifyInstruction should not add instructions to the IR by making it clearer
that it is an analysis, not a pass.
Swift SVN r21752