From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH 3/5] IR: remove never-generated instructions
Date: Wed, 14 Feb 2018 02:08:41 +0100 [thread overview]
Message-ID: <20180214010843.23651-4-luc.vanoostenryck@gmail.com> (raw)
In-Reply-To: <20180214010843.23651-1-luc.vanoostenryck@gmail.com>
Some of the IR instructions have been defined but are
never generated.
Remove them as they have no purposes.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
Documentation/IR.md | 10 ----------
example.c | 8 --------
linearize.c | 8 --------
linearize.h | 10 +---------
liveness.c | 8 --------
5 files changed, 1 insertion(+), 43 deletions(-)
diff --git a/Documentation/IR.md b/Documentation/IR.md
index 1612f3390..27adc91a6 100644
--- a/Documentation/IR.md
+++ b/Documentation/IR.md
@@ -357,13 +357,3 @@ No-op (should never be generated).
#### OP_DEATHNOTE
Annotation telling the pseudo will be death after the next
instruction (other than some other annotation, that is).
-
-### Unused ops
-#### OP_VANEXT
-#### OP_VAARG
-#### OP_MALLOC
-#### OP_FREE
-#### OP_ALLOCA
-#### OP_GET_ELEMENT_PTR
-#### OP_INVOKE
-#### OP_UNWIND
diff --git a/example.c b/example.c
index e3d2a6c26..7aa8f8c17 100644
--- a/example.c
+++ b/example.c
@@ -25,9 +25,7 @@ static const char *opcodes[] = {
[OP_BR] = "br",
[OP_CBR] = "cbr",
[OP_SWITCH] = "switch",
- [OP_INVOKE] = "invoke",
[OP_COMPUTEDGOTO] = "jmp *",
- [OP_UNWIND] = "unwind",
/* Binary */
[OP_ADD] = "add",
@@ -69,13 +67,9 @@ static const char *opcodes[] = {
[OP_SEL] = "select",
/* Memory */
- [OP_MALLOC] = "malloc",
- [OP_FREE] = "free",
- [OP_ALLOCA] = "alloca",
[OP_LOAD] = "load",
[OP_STORE] = "store",
[OP_SETVAL] = "set",
- [OP_GET_ELEMENT_PTR] = "getelem",
/* Other */
[OP_PHI] = "phi",
@@ -86,8 +80,6 @@ static const char *opcodes[] = {
[OP_FPCAST] = "fpcast",
[OP_PTRCAST] = "ptrcast",
[OP_CALL] = "call",
- [OP_VANEXT] = "va_next",
- [OP_VAARG] = "va_arg",
[OP_SLICE] = "slice",
[OP_NOP] = "nop",
[OP_DEATHNOTE] = "dead",
diff --git a/linearize.c b/linearize.c
index 7cc60c4f1..0fa12c36f 100644
--- a/linearize.c
+++ b/linearize.c
@@ -172,9 +172,7 @@ static const char *opcodes[] = {
[OP_BR] = "br",
[OP_CBR] = "cbr",
[OP_SWITCH] = "switch",
- [OP_INVOKE] = "invoke",
[OP_COMPUTEDGOTO] = "jmp *",
- [OP_UNWIND] = "unwind",
/* Binary */
[OP_ADD] = "add",
@@ -239,15 +237,11 @@ static const char *opcodes[] = {
[OP_SEL] = "select",
/* Memory */
- [OP_MALLOC] = "malloc",
- [OP_FREE] = "free",
- [OP_ALLOCA] = "alloca",
[OP_LOAD] = "load",
[OP_STORE] = "store",
[OP_SETVAL] = "set",
[OP_SETFVAL] = "setfval",
[OP_SYMADDR] = "symaddr",
- [OP_GET_ELEMENT_PTR] = "getelem",
/* Other */
[OP_PHI] = "phi",
@@ -258,8 +252,6 @@ static const char *opcodes[] = {
[OP_PTRCAST] = "ptrcast",
[OP_INLINED_CALL] = "# call",
[OP_CALL] = "call",
- [OP_VANEXT] = "va_next",
- [OP_VAARG] = "va_arg",
[OP_SLICE] = "slice",
[OP_NOP] = "nop",
[OP_DEATHNOTE] = "dead",
diff --git a/linearize.h b/linearize.h
index 6640fcf2e..8ff40948c 100644
--- a/linearize.h
+++ b/linearize.h
@@ -143,10 +143,8 @@ enum opcode {
OP_BR,
OP_CBR,
OP_SWITCH,
- OP_INVOKE,
OP_COMPUTEDGOTO,
- OP_UNWIND,
- OP_TERMINATOR_END = OP_UNWIND,
+ OP_TERMINATOR_END = OP_COMPUTEDGOTO,
/* Binary */
OP_BINARY,
@@ -213,15 +211,11 @@ enum opcode {
OP_SEL,
/* Memory */
- OP_MALLOC,
- OP_FREE,
- OP_ALLOCA,
OP_LOAD,
OP_STORE,
OP_SETVAL,
OP_SETFVAL,
OP_SYMADDR,
- OP_GET_ELEMENT_PTR,
/* Other */
OP_PHI,
@@ -232,8 +226,6 @@ enum opcode {
OP_PTRCAST,
OP_INLINED_CALL,
OP_CALL,
- OP_VANEXT,
- OP_VAARG,
OP_SLICE,
OP_NOP,
OP_DEATHNOTE,
diff --git a/liveness.c b/liveness.c
index 07a95d68b..0c525112b 100644
--- a/liveness.c
+++ b/liveness.c
@@ -142,14 +142,6 @@ static void track_instruction_usage(struct basic_block *bb, struct instruction *
break;
case OP_BADOP:
- case OP_INVOKE:
- case OP_UNWIND:
- case OP_MALLOC:
- case OP_FREE:
- case OP_ALLOCA:
- case OP_GET_ELEMENT_PTR:
- case OP_VANEXT:
- case OP_VAARG:
case OP_NOP:
case OP_CONTEXT:
break;
--
2.16.0
next prev parent reply other threads:[~2018-02-14 1:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-14 1:08 [PATCH 0/5] IR cleanup Luc Van Oostenryck
2018-02-14 1:08 ` [PATCH 1/5] IR: fix typo in IR doc Luc Van Oostenryck
2018-02-14 1:08 ` [PATCH 2/5] IR: remove now unused OP_LNOP & OP_SNOP Luc Van Oostenryck
2018-02-14 1:08 ` Luc Van Oostenryck [this message]
2018-02-14 5:08 ` [PATCH 3/5] IR: remove never-generated instructions Dibyendu Majumdar
2018-02-14 21:48 ` Luc Van Oostenryck
2018-02-14 1:08 ` [PATCH 4/5] IR: let .cond unionize with .src and not .target Luc Van Oostenryck
2018-02-14 1:08 ` [PATCH 5/5] IR: let OP_COMPUTEGOTO use .src instead of .target 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=20180214010843.23651-4-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 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).