mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-03-11 03:13:06 +00:00
Tiny codegen optimization: silently ignore the creation of STORE with input and output being the same address
This commit is contained in:
parent
8acfd87039
commit
37fbe7176f
1 changed files with 10 additions and 0 deletions
10
ir.c
10
ir.c
|
@ -2832,6 +2832,16 @@ tailcall:
|
|||
/* 2-operand instructions with A -> B */
|
||||
stmt.o2.u1 = stmt.o3.u1;
|
||||
stmt.o3.u1 = 0;
|
||||
|
||||
/* tiny optimization, don't output
|
||||
* STORE a, a
|
||||
*/
|
||||
if (stmt.o2.u1 == stmt.o1.u1 &&
|
||||
OPTS_OPTIMIZATION(OPTIM_MINOR))
|
||||
{
|
||||
++optimization_count[OPTIM_MINOR];
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
code_push_statement(&stmt, instr->context.line);
|
||||
|
|
Loading…
Reference in a new issue