[PATCH] D22477: [InstCombine] fold add(zext(xor X, C), C) --> sext X when C is INT_MIN in the source type
David Majnemer via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 18 14:55:33 PDT 2016
majnemer added inline comments.
================
Comment at: lib/Transforms/InstCombine/InstCombineAddSub.cpp:1054
@@ +1053,3 @@
+ const APInt *C;
+ if (match(LHS, m_OneUse(m_ZExt(m_OneUse(m_Xor(m_Value(X), m_APInt(C)))))) &&
+ C->isMinSignedValue() &&
----------------
spatel wrote:
> majnemer wrote:
> > Why `m_OneUse` ?
> I was being conservative, but given that we'd at least shorten the dependency chain for this result regardless of other uses of the zext/xor, we don't need those checks.
>
> I can remove the m_OneUse and add some more tests to this patch, or if you prefer, I'll add a TODO and follow-up patch.
It seems much more canonical, I'd just remove the OneUse.
https://reviews.llvm.org/D22477
More information about the llvm-commits
mailing list