llvm-6502/lib
David Majnemer 5624046453 InstCombine: Simplify (A ^ B) or/and (A ^ B ^ C)
While we can already transform A | (A ^ B) into A | B, things get bad
once we have (A ^ B) | (A ^ B ^ Cst) because reassociation will morph
this into (A ^ B) | ((A ^ Cst) ^ B).  Our existing patterns fail once
this happens.

To fix this, we add a new pattern which looks through the tree of xor
binary operators to see that, in fact, there exists a redundant xor
operation.

What follows bellow is a correctness proof of the transform using CVC3.

$ cat t.cvc
A, B, C : BITVECTOR(64);

QUERY BVXOR(A, B) | BVXOR(BVXOR(B, C), A) = BVXOR(A, B) | C;
QUERY BVXOR(BVXOR(A, C), B) | BVXOR(A, B) = BVXOR(A, B) | C;

QUERY BVXOR(A, B) & BVXOR(BVXOR(B, C), A) = BVXOR(A, B) & ~C;
QUERY BVXOR(BVXOR(A, C), B) & BVXOR(A, B) = BVXOR(A, B) & ~C;

$ cvc3 < t.cvc
Valid.
Valid.
Valid.
Valid.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214342 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-30 21:26:37 +00:00
..
Analysis Add @llvm.assume, lowering, and some basic properties 2014-07-25 21:13:35 +00:00
AsmParser
Bitcode UseListOrder: Visit global values 2014-07-30 17:51:09 +00:00
CodeGen Refactor duplicated code. 2014-07-30 19:42:16 +00:00
DebugInfo
ExecutionEngine [MCJIT] Fix the ARM BR24 relocation in RuntimeDyldMachO. 2014-07-30 03:35:05 +00:00
IR Feedback on r214189, no functionality change. 2014-07-29 22:58:13 +00:00
IRReader
LineEditor
Linker
LTO Refactor duplicated code. 2014-07-30 19:42:16 +00:00
MC
Object
Option
ProfileData llvm-profdata: Clean up and reorganize some tests 2014-07-29 22:29:23 +00:00
Support Remove dead code. 2014-07-25 19:06:39 +00:00
TableGen
Target Add rfdi and rfmci from the e500/e500mc ISA. 2014-07-30 21:09:03 +00:00
Transforms InstCombine: Simplify (A ^ B) or/and (A ^ B ^ C) 2014-07-30 21:26:37 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile