Enforce encodings for instructions with side effects.

We allow ghost instructions to exist if they have no side effects.
Instructions that affect control flow or that have other side effects
must be encoded.

Teach the IL verifier to enforce this. Once any instruction has an
encoding, all instructions with side effects must have an encoding.
This commit is contained in:
Jakob Stoklund Olesen
2017-07-12 09:29:48 -07:00
parent 6ee432329d
commit 24b53efc9d
2 changed files with 61 additions and 21 deletions

View File

@@ -59,7 +59,7 @@ ebb0(v0: i32):
brnz v0, ebb1(v0)
v1 = iadd_imm v0, 7
; v1 and v0 interfere here:
trapnz v0
v2 = iadd_imm v0, 8
; check: $(cp1=$V) = copy $v1
; not: copy
; check: jump $ebb1($cp1)