Try this:
```
 /* A == CST ? A : CST -> CST.  */
         (simplify
          (cnd (eq @0 CONSTANT_CLASS_P@1) (nop_convert? @0) CONSTANT_CLASS_P@2)
          (if (ANY_INTEGRAL_TYPE_P (type)
               && operand_equal_p (@1, @2))
           (convert @1)))
 /* A != CST ? CST : A -> CST.  */
         (simplify
          (cnd (ne @0 CONSTANT_CLASS_P@1) CONSTANT_CLASS_P@2 (nop_convert? @0))
          (if (ANY_INTEGRAL_TYPE_P (type)
               && operand_equal_p (@1, @2))
           (convert @1)))
```

VECTOR_CST should be last due to:
```
bool
tree_swap_operands_p (const_tree arg0, const_tree arg1)
{
  if (CONSTANT_CLASS_P (arg1))
    return false;
  if (CONSTANT_CLASS_P (arg0))
    return true;
```



--
https://forge.sourceware.org/gcc/gcc/pulls/193#issuecomment-6749

Reply via email to