Make GVN aware of instructions that write to CPU flags.

This commit is contained in:
Dan Gohman
2017-10-19 12:57:55 -07:00
parent bce3c38042
commit cc0bb70c5d
4 changed files with 29 additions and 1 deletions

View File

@@ -23,3 +23,19 @@ ebb0:
v5 = iadd v4, v3
return v5
}
function %cpu_flags() -> b1 {
ebb0:
v0 = iconst.i32 7
v1 = iconst.i32 8
v2 = ifcmp v0, v1
v3 = trueif eq v2
v4 = ifcmp v0, v1
v5 = trueif eq v4
v6 = bor v3, v5
; check: v2 = ifcmp v0, v1
; check: v3 = trueif eq v2
; check: v4 = ifcmp v0, v1
; check: v5 = trueif eq v4
return v6
}