[PATCH] D117983: [DAG] Fold (X & Y) != 0 --> zextOrTrunc(X & Y) iff everything but LSB is known zero (PR51312)
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 23 07:45:29 PST 2022
lebedev.ri accepted this revision.
lebedev.ri added a comment.
This revision is now accepted and ready to land.
LG, thanks.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:3273-3274
+ APInt UpperBits = APInt::getHighBitsSet(NumEltBits, NumEltBits - 1);
+ if (DAG.MaskedValueIsZero(N0, UpperBits))
+ return DAG.getZExtOrTrunc(N0, DL, VT);
+ }
----------------
?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D117983/new/
https://reviews.llvm.org/D117983
More information about the llvm-commits
mailing list