All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH 00/13] remove phi-sources from removed branches
Date: Sun, 21 Mar 2021 13:34:52 +0100	[thread overview]
Message-ID: <20210321123505.27993-1-luc.vanoostenryck@gmail.com> (raw)

This series, after some related and preparatory patches, contains
fixes for the problem of phi-sources being left in place after their
corresponding branches have been removed. This results in situations,
for example, where a phi-node has 3 arguments/inputs/sources but only
2 parent BBs and create all sort of problems, like:
* some dead code is not removed
* some optimizations involving phi-nodes are blocked (if-conversions)
* more importantly, these phi-nodes are invalid/meaningless and so
  it's impossible to reason correctly about them.

Note: This series only fixes *some* of these problems. Other probably
      still exists, especially when rewrite_branch() is used.


Luc Van Oostenryck (13):
  Revert "simplify CBR-CBR on the same condition"
  add testcases to check if phi-sources from removed targets are removed
    too
  remove insert_branch() redundant arg
  simplify remove_parent()
  fold remove_parent() into insert_branch()
  let insert_branch() reuse the terminating instruction
  move insert_branch() to flow.c
  let insert_branch() return a status
  rename insert_branch() to convert_to_jump()
  add remove_phisources()
  fix phisources during CBR-BR conversion
  use convert_to_jump() when converting a CBR with same targets
  fix phisources during SWITCH-BR conversion

 flow.c                          | 205 +++++++++++++++-----------------
 flow.h                          |   3 +
 linearize.c                     |  36 ------
 linearize.h                     |   1 -
 simplify.c                      |  34 ++----
 validation/optim/bad-phisrc1.c  |  15 +++
 validation/optim/bad-phisrc1a.c |  23 ++++
 validation/optim/bad-phisrc2.c  |  16 +++
 validation/optim/bad-phisrc3.c  |  20 ++++
 9 files changed, 184 insertions(+), 169 deletions(-)
 create mode 100644 validation/optim/bad-phisrc1.c
 create mode 100644 validation/optim/bad-phisrc1a.c
 create mode 100644 validation/optim/bad-phisrc2.c
 create mode 100644 validation/optim/bad-phisrc3.c

-- 
2.31.0


             reply	other threads:[~2021-03-21 12:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-21 12:34 Luc Van Oostenryck [this message]
2021-03-21 12:34 ` [PATCH 01/13] Revert "simplify CBR-CBR on the same condition" Luc Van Oostenryck
2021-03-21 12:34 ` [PATCH 02/13] add testcases to check if phi-sources from removed targets are removed too Luc Van Oostenryck
2021-03-21 12:34 ` [PATCH 03/13] remove insert_branch() redundant arg Luc Van Oostenryck
2021-03-21 12:34 ` [PATCH 04/13] simplify remove_parent() Luc Van Oostenryck
2021-03-21 12:34 ` [PATCH 05/13] fold remove_parent() into insert_branch() Luc Van Oostenryck
2021-03-21 12:34 ` [PATCH 06/13] let insert_branch() reuse the terminating instruction Luc Van Oostenryck
2021-03-21 12:34 ` [PATCH 07/13] move insert_branch() to flow.c Luc Van Oostenryck
2021-03-21 12:35 ` [PATCH 08/13] let insert_branch() return a status Luc Van Oostenryck
2021-03-21 12:35 ` [PATCH 09/13] rename insert_branch() to convert_to_jump() Luc Van Oostenryck
2021-03-21 12:35 ` [PATCH 10/13] add remove_phisources() Luc Van Oostenryck
2021-03-21 12:35 ` [PATCH 11/13] fix phisources during CBR-BR conversion Luc Van Oostenryck
2021-03-21 12:35 ` [PATCH 12/13] use convert_to_jump() when converting a CBR with same targets Luc Van Oostenryck
2021-03-21 12:35 ` [PATCH 13/13] fix phisources during SWITCH-BR conversion Luc Van Oostenryck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210321123505.27993-1-luc.vanoostenryck@gmail.com \
    --to=luc.vanoostenryck@gmail.com \
    --cc=linux-sparse@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.