[llvm] [DAGCombiner] Remove a hasOneUse check in visitAND (PR #115142)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 6 03:14:44 PST 2024


================
@@ -7095,8 +7095,7 @@ SDValue DAGCombiner::visitAND(SDNode *N) {
     // fold (and (masked_load) (splat_vec (x, ...))) to zext_masked_load
     auto *MLoad = dyn_cast<MaskedLoadSDNode>(N0);
     ConstantSDNode *Splat = isConstOrConstSplat(N1, true, true);
-    if (MLoad && MLoad->getExtensionType() == ISD::EXTLOAD && Splat &&
-        N1.hasOneUse()) {
----------------
paulwalker-arm wrote:

You can see from the code the transformation has explicit handling for this.  The original load is an any-extend and so the transformation is simply promoting this to a zero-extend which can be used by all uses.

https://github.com/llvm/llvm-project/pull/115142


More information about the llvm-commits mailing list