Fix a XOR reassociation bug.
authorShuxin Yang <shuxin.llvm@gmail.com>
Sat, 27 Apr 2013 18:02:12 +0000 (18:02 +0000)
committerShuxin Yang <shuxin.llvm@gmail.com>
Sat, 27 Apr 2013 18:02:12 +0000 (18:02 +0000)
commit4d4c54d29ff911f59fe2be1a31331dbcbb741f5f
tree7462985c701c756423fce2663a8820dee00f7223
parent595dd5af1438141dde4f19225d5b57170c651731
Fix a XOR reassociation bug.

When Reassociator optimize "(x | C1)" ^ "(X & C2)", it may swap the two
subexpressions, however, it forgot to swap cached constants (of C1 and C2)
accordingly.

rdar://13739160

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180676 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/Reassociate.cpp
test/Transforms/Reassociate/xor_reassoc.ll