peepmatic: Fix a failed assertion due to extra iterations after fixed point

After replacing an instruction with an alias to an earlier value, trying to
further optimize that value is unnecessary, since we've already processed it,
and also was triggering an assertion.
This commit is contained in:
Nick Fitzgerald
2020-05-07 17:13:03 -07:00
parent eb2dab0aa4
commit 6e135b3aea
2 changed files with 34 additions and 2 deletions

View File

@@ -0,0 +1,14 @@
test simple_preopt
target x86_64
;; This file used to trigger assertions where we would keep trying to
;; unnecessarily apply optimizations after replacing an instruction with an
;; alias of another value that we had already optimized.
function %foo() {
block0:
v0 = iconst.i32 3
v1 = srem_imm v0, 2
v2 = sdiv_imm v1, 1
trap unreachable
}