[llvm] [X86] Invert (and X, ~(and ~Y, Z)) back into (and X, (or Y, ~Z)) (PR #109215)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 9 15:09:12 PDT 2024
================
@@ -50034,6 +50034,32 @@ static bool hasBZHI(const X86Subtarget &Subtarget, MVT VT) {
(VT == MVT::i32 || (VT == MVT::i64 && Subtarget.is64Bit()));
}
+/// InstCombine converts:
+/// `(and X, ~(and ~Y, Z))`
+/// to
+/// `(and X, (or Y, ~Z))`
+///
+/// But we should undo this transformation if the `andn` instruction is
+/// available to us.
+static SDValue combineAndNotOrIntoAndNotAnd(SDNode *N, SelectionDAG &DAG,
+ const X86Subtarget &Subtarget) {
----------------
goldsteinn wrote:
Think there is a missing check for whether andn is supported...
https://github.com/llvm/llvm-project/pull/109215
More information about the llvm-commits
mailing list