[PATCH] D119559: [DAGCombine] Basic combines for AVG nodes.

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 11 10:59:23 PST 2022


dmgreen added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:4693
+  if (N0.isUndef() || N1.isUndef())
+    return DAG.getConstant(0, DL, VT);
+
----------------
RKSimon wrote:
> Why 0 and not the other (not undef) arg? https://alive2.llvm.org/ce/z/tNnJR3
I got 0 from the "haddu_undef" tests, but I see now that they were not extending the undef, which changes how they simplify.

I went back and forth with several options, but if the "other operand" verifies then that sounds good to me.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119559/new/

https://reviews.llvm.org/D119559



More information about the llvm-commits mailing list