Thanks Robin for fixing it.

-  : cond (cond_in), else_value (else_value_in)
+  : cond (cond_in), else_value (else_value_in), len (NULL_TREE),
+    bias (NULL_TREE)It seems that you shouldn't include this fix in the patch?
+
+  if (len)
+    {
+      /* If we had a COND_LEN before we need to ensure that it stays that
+        way.  */
+      gimple_match_op old_op = *res_op;
+      *res_op = cond_op;
+      maybe_resimplify_conditional_op (seq, res_op, valueize);
+
+      auto cfn = combined_fn (res_op->code);
+      if (internal_fn_p (cfn)
+         && internal_fn_len_index (as_internal_fn (cfn)) != -1)
+       return true;
+
+      *res_op = old_op;
+      return false;
+    }
+  else
+    {
+      *res_op = cond_op;
+      maybe_resimplify_conditional_op (seq, res_op, valueize);
+      return true;
+    }
This looks odd to me. 

Currently, we never has cond_len_xxx with dummy length (length = VF) and we 
always use cond_xxx if we don't have a loop mask.
So, the length of cond_len_xxx is always generated by MIN or SELET_VL. 
I think we don't need the gimple simplification like cond_len -> into argument 
value.

But we need this following optimization:

negate + cond_len_fma -> cond_len_fnma/cond_len_fms/cond_len_fnms.
That's what I want to support in gimple fold.

Let's see more comments from Richard and Richi.



juzhe.zh...@rivai.ai

Reply via email to