From 03aa6219fd8c79d4872ee88a72d8c16237269782 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sun, 19 Dec 2004 16:32:57 -0700 Subject: [PATCH] Make output_insn() tell where it was called from, and avoid doing unnecessary register->sameregister moves. --- example.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/example.c b/example.c index 9b943b74..d4f4c32e 100644 --- a/example.c +++ b/example.c @@ -262,6 +262,9 @@ static void output_insn(struct bb_state *state, const char *fmt, ...) output_line(state, "\t%s\n", buffer); } +#define output_insn(state, fmt, arg...) \ + output_insn(state, fmt "\t\t# %s" , ## arg , __FUNCTION__) + static void output_comment(struct bb_state *state, const char *fmt, ...) { static char buffer[512]; @@ -647,6 +650,10 @@ static struct hardreg *copy_reg(struct bb_state *state, struct hardreg *src, pse int i; struct hardreg *reg; + /* If the container has been killed off, just re-use it */ + if (!src->contains) + return src; + /* If "src" only has one user, and the contents are dead, we can re-use it */ if (src->busy == 1 && src->dead == 1) return src; -- 2.11.4.GIT