simplify-rtx: Parity of parity is parity
authorRoger Sayle <roger@nextmovesoftware.com>
Wed, 24 Jun 2020 18:48:43 +0000 (18:48 +0000)
committerSegher Boessenkool <segher@kernel.crashing.org>
Wed, 24 Jun 2020 19:27:56 +0000 (19:27 +0000)
2020-06-24  Roger Sayle  <roger@nextmovesoftware.com>

* simplify-rtx.c (simplify_unary_operation_1): Simplify
(parity (parity x)) as (parity x), i.e. PARITY is idempotent.

gcc/simplify-rtx.c

index 28c2dc69ae7de9bbfee8e8590fcbedea55350d98..65008eaab45887d10d31ffd19d174f31a2ad7cf7 100644 (file)
@@ -1391,6 +1391,10 @@ simplify_unary_operation_1 (enum rtx_code code, machine_mode mode, rtx op)
                                       GET_MODE (XEXP (op, 0)));
          break;
 
+       case PARITY:
+         /* (parity (parity x)) -> parity (x).  */
+         return op;
+
        default:
          break;
        }