Skip to content

Commit 7a18198

Browse files
committed
[InstCombine] Fix nits in new xor fold
Followup to #105992, use the simplifyXorInst helper and use getWithInstruction consistently.
1 parent d36f66b commit 7a18198

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4699,11 +4699,10 @@ Instruction *InstCombinerImpl::visitXor(BinaryOperator &I) {
46994699
// (X | Y) ^ M -> (Y ^ M) ^ X
47004700
if (match(&I, m_c_Xor(m_OneUse(m_DisjointOr(m_Value(X), m_Value(Y))),
47014701
m_Value(M)))) {
4702-
if (Value *XorAC =
4703-
simplifyBinOp(Instruction::Xor, X, M, SQ.getWithInstruction(&I)))
4702+
if (Value *XorAC = simplifyXorInst(X, M, SQ.getWithInstruction(&I)))
47044703
return BinaryOperator::CreateXor(XorAC, Y);
47054704

4706-
if (Value *XorBC = simplifyBinOp(Instruction::Xor, Y, M, SQ))
4705+
if (Value *XorBC = simplifyXorInst(Y, M, SQ.getWithInstruction(&I)))
47074706
return BinaryOperator::CreateXor(XorBC, X);
47084707
}
47094708

0 commit comments

Comments
 (0)