linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] simplify logical negation
@ 2020-11-22 15:27 Luc Van Oostenryck
  2020-11-22 15:27 ` [PATCH 1/7] not: add testcases for canonicalization & simplification of negations Luc Van Oostenryck
                   ` (6 more replies)
  0 siblings, 7 replies; 22+ messages in thread
From: Luc Van Oostenryck @ 2020-11-22 15:27 UTC (permalink / raw)
  To: linux-sparse; +Cc: Luc Van Oostenryck

This series contains simplifications for tautologies and
contradictions involving logical negation, like (~x & x)
or ((x > y) | (x <= y)).

As a bonus (but needed for these simplifications), now
PSEUDO_REGs and PSEUDO_ARGs are also taken in account when
checking if operands are in canonical order, which creates
a few CSE opportunities of its own.


Luc Van Oostenryck (7):
  not: add testcases for canonicalization & simplification of negations
  canon: put PSEUDO_ARGs in canonical order too
  canon: put PSEUDO_REGs in canonical order too
  canon: simplify calculation of canonical order
  opcode: add helpers opcode_negate() & opcode_swap()
  not: simplify (~x {&,|,^} x) --> {0,~0,~0}
  not: simplify ((x cmp y) {&,|,^} (x !cmp y)) --> {0,1,1}

 linearize.h                         |   4 +-
 opcode.h                            |  10 +++
 simplify.c                          | 118 +++++++++++++++++++++++++---
 validation/linear/pointer-arith32.c |  12 +--
 validation/linear/pointer-arith64.c |  10 +--
 validation/optim/canonical-arg.c    |  20 +++++
 validation/optim/canonical-not.c    |   9 +++
 validation/optim/cse-arg01.c        |   9 +++
 validation/optim/cse-not01.c        |  11 +++
 validation/optim/cse-not02.c        |  11 +++
 validation/optim/cse-reg01.c        |   9 +++
 11 files changed, 200 insertions(+), 23 deletions(-)
 create mode 100644 validation/optim/canonical-arg.c
 create mode 100644 validation/optim/canonical-not.c
 create mode 100644 validation/optim/cse-arg01.c
 create mode 100644 validation/optim/cse-not01.c
 create mode 100644 validation/optim/cse-not02.c
 create mode 100644 validation/optim/cse-reg01.c

-- 
2.29.2


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2020-11-27 22:46 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-22 15:27 [PATCH 0/7] simplify logical negation Luc Van Oostenryck
2020-11-22 15:27 ` [PATCH 1/7] not: add testcases for canonicalization & simplification of negations Luc Van Oostenryck
2020-11-22 19:00   ` Linus Torvalds
2020-11-22 19:57     ` Luc Van Oostenryck
2020-11-22 20:13       ` Linus Torvalds
2020-11-22 20:38         ` Luc Van Oostenryck
2020-11-22 22:26         ` Luc Van Oostenryck
2020-11-27 22:25         ` [PATCH 0/6] 'bits translation' simplification Luc Van Oostenryck
2020-11-27 22:25           ` [PATCH 1/6] add testscases for 'bits translation' optimization Luc Van Oostenryck
2020-11-27 22:25           ` [PATCH 2/6] factorize SEL(x, OP(y,z), y) into OP(SEL(x, z, 0), y) Luc Van Oostenryck
2020-11-27 22:25           ` [PATCH 3/6] add helper is_power_of_2() Luc Van Oostenryck
2020-11-27 22:25           ` [PATCH 4/6] add helper is_pow2() Luc Van Oostenryck
2020-11-27 22:25           ` [PATCH 5/6] add log base 2 function: log2_exact() Luc Van Oostenryck
2020-11-27 22:25           ` [PATCH 6/6] convert SEL(x & BIT1, BIT2, 0) into SHIFT(x & BIT1, S) Luc Van Oostenryck
2020-11-27 22:25           ` [PATCH 7/7] move up instructions blocking if-conversion Luc Van Oostenryck
2020-11-27 22:44           ` [PATCH 0/6] 'bits translation' simplification Linus Torvalds
2020-11-22 15:27 ` [PATCH 2/7] canon: put PSEUDO_ARGs in canonical order too Luc Van Oostenryck
2020-11-22 15:27 ` [PATCH 3/7] canon: put PSEUDO_REGs " Luc Van Oostenryck
2020-11-22 15:27 ` [PATCH 4/7] canon: simplify calculation of canonical order Luc Van Oostenryck
2020-11-22 15:27 ` [PATCH 5/7] opcode: add helpers opcode_negate() & opcode_swap() Luc Van Oostenryck
2020-11-22 15:27 ` [PATCH 6/7] not: simplify (~x {&,|,^} x) --> {0,~0,~0} Luc Van Oostenryck
2020-11-22 15:27 ` [PATCH 7/7] not: simplify ((x cmp y) {&,|,^} (x !cmp y)) --> {0,1,1} Luc Van Oostenryck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).