summaryrefslogtreecommitdiffhomepage
path: root/ir/be/mips
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2017-01-22 16:16:14 +0100
committerChristoph Mallon <christoph.mallon@gmx.de>2017-01-22 16:18:30 +0100
commitdc9ff7195b786f8a26425b70770233772701f2c0 (patch)
treeda6e7d837576c7dede045a6ff474098ffad46391 /ir/be/mips
parent7e62988f8c4c7f722d8298261153f773a608fde1 (diff)
mips: Avoid unnecessary sign/zero extension right after Load.
Diffstat (limited to 'ir/be/mips')
-rw-r--r--ir/be/mips/mips_transform.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ir/be/mips/mips_transform.c b/ir/be/mips/mips_transform.c
index a6ed8a8..a990502 100644
--- a/ir/be/mips/mips_transform.c
+++ b/ir/be/mips/mips_transform.c
@@ -131,6 +131,13 @@ static ir_node *make_extension(dbg_info *const dbgi, ir_node *const op, unsigned
if (op_size >= to_size)
return new_op;
+ /* Check whether the value is correctly extended already. */
+ if (is_Proj(op)) {
+ ir_node *const pred = get_Proj_pred(op);
+ if (is_Load(pred))
+ return new_op;
+ }
+
assert(op_size <= 16);
ir_node *const block = get_nodes_block(new_op);
if (mode_is_signed(op_mode)) {