[PATCH] D50604: [InstCombine] Replace call to haveNoCommonBitsSet in visitXor with just the special case that doesn't use computeKnownBits.
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 12 00:29:50 PDT 2018
lebedev.ri accepted this revision.
lebedev.ri added a comment.
This revision is now accepted and ready to land.
This is a NFC, right?
I suppose it makes sense. I kinda hoped inlining would have taken care of it.
There may be a similar case in the `visitAdd()`.
================
Comment at: lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:2513
+ // Fold (X & M) ^ (Y & ~M) -> (X & M) | (Y & ~M)
+ // This it a special case in haveNoCommonBitsSet, but the commputeKnownBits
+ // calls in there are unnecessary as SimplifyDemandedInstructionBits should
----------------
s/it/is/
================
Comment at: lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:2517-2520
+ if ((match(Op0, m_c_And(m_Not(m_Value(M)), m_Value())) &&
+ match(Op1, m_c_And(m_Specific(M), m_Value()))) ||
+ (match(Op1, m_c_And(m_Not(m_Value(M)), m_Value())) &&
+ match(Op0, m_c_And(m_Specific(M), m_Value()))))
----------------
Here this could be
```
if (match(&I, m_c_Xor(m_c_And(m_Not(m_Value(M)), m_Value()),
m_c_And(m_Deferred(M), m_Value()))))
```
Repository:
rL LLVM
https://reviews.llvm.org/D50604
More information about the llvm-commits
mailing list