From d5522af2a968f5745feed83e60cc93f6bf65bdbc Mon Sep 17 00:00:00 2001 From: Drahflow Date: Thu, 11 Jun 2015 17:26:54 +0200 Subject: Omit trace tests if useless --- TODO | 2 -- elymas/lib/sys/opt.ey | 24 ++++++++++++++---------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/TODO b/TODO index 4793238..13eeab8 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,3 @@ -* exercise the optimizer before freezing optimize -* why is vp3view crashing? * apply the trace extractor to non-tail situations * utf8 * regex substitution diff --git a/elymas/lib/sys/opt.ey b/elymas/lib/sys/opt.ey index 35345b4..a2c7f71 100644 --- a/elymas/lib/sys/opt.ey +++ b/elymas/lib/sys/opt.ey @@ -2102,16 +2102,20 @@ } { action CONDITIONALTAIL eq }' { - [ - 1 /rax :movqImmReg - ] emitOpcodes - 1 entry emitOpcodes - [ - /rax /rax :testqRegReg - 2 entry len newFooter len add :jzRel32 - ] emitOpcodes - 2 entry emitOpcodes - newFooter emitOpcodes + 1 entry len { + [ + 1 /rax :movqImmReg + ] emitOpcodes + 1 entry emitOpcodes + [ + /rax /rax :testqRegReg + 2 entry len newFooter len add :jzRel32 + ] emitOpcodes + 2 entry emitOpcodes + newFooter emitOpcodes + } { + 2 entry emitOpcodes # test would always succeed, footer will follow immediately + } ? * } { 1 }' { -- cgit v1.2.3