[llvm] [DAGCombiner] Mark vectors as not AllAddOne/AllSubOne on undef or type mismatch (PR #92195)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue May 14 19:19:45 PDT 2024


================
@@ -12140,10 +12140,16 @@ SDValue DAGCombiner::foldVSelectOfConstants(SDNode *N) {
   for (unsigned i = 0; i != Elts; ++i) {
     SDValue N1Elt = N1.getOperand(i);
     SDValue N2Elt = N2.getOperand(i);
-    if (N1Elt.isUndef() || N2Elt.isUndef())
+    if (N1Elt.isUndef() || N2Elt.isUndef()) {
+      AllAddOne = false;
----------------
topperc wrote:

This loop may have been trying to ignore undefs.

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


More information about the llvm-commits mailing list