aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-11-18 22:33:20 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-03-01 09:07:45 +0100
commit5e7e4bdd97fc0f363762847fced34583ba47c9d0 (patch)
tree424b42242aafa364343767bf3491e292c52ceedb
parent29f889c3980d4f36f9f87a667b3ba597d97cbf82 (diff)
downloadsparse-dev-5e7e4bdd97fc0f363762847fced34583ba47c9d0.tar.gz
IR: remove never-generated instructions
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>
-rw-r--r--Documentation/IR.md10
-rw-r--r--example.c8
-rw-r--r--linearize.c8
-rw-r--r--linearize.h10
-rw-r--r--liveness.c8
5 files changed, 1 insertions, 43 deletions
diff --git a/Documentation/IR.md b/Documentation/IR.md
index 44893ade..b9749dff 100644
--- a/Documentation/IR.md
+++ b/Documentation/IR.md
@@ -354,13 +354,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 54986a54..fd22d8ab 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",
@@ -68,13 +66,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",
@@ -85,8 +79,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 6509fa03..eaa8913b 100644
--- a/linearize.c
+++ b/linearize.c
@@ -177,9 +177,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",
@@ -243,15 +241,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",
@@ -262,8 +256,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 01f459ab..5162e6c2 100644
--- a/linearize.h
+++ b/linearize.h
@@ -142,10 +142,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,
@@ -212,15 +210,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,
@@ -231,8 +225,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 8f2c76f8..9d224e1e 100644
--- a/liveness.c
+++ b/liveness.c
@@ -143,14 +143,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;