From a8da70a3739af08fe3e9427276daf128139aee22 Mon Sep 17 00:00:00 2001 From: Siddharth Bhat Date: Mon, 30 Oct 2023 20:24:03 +0000 Subject: [PATCH 01/12] wip: implement alive translation --- .../InstCombine/AliveAutoGenerated.lean | 4005 ++++++++++++++++- SSA/Projects/InstCombine/LLVM/Transform.lean | 12 +- related-work/alive/alive | 2 +- 3 files changed, 3983 insertions(+), 36 deletions(-) diff --git a/SSA/Projects/InstCombine/AliveAutoGenerated.lean b/SSA/Projects/InstCombine/AliveAutoGenerated.lean index 4cf5782f0..8eea3b28c 100644 --- a/SSA/Projects/InstCombine/AliveAutoGenerated.lean +++ b/SSA/Projects/InstCombine/AliveAutoGenerated.lean @@ -1,37 +1,19 @@ + import SSA.Projects.InstCombine.LLVM.EDSL import SSA.Projects.InstCombine.AliveStatements import SSA.Projects.InstCombine.Refinement import SSA.Projects.InstCombine.Tactic open MLIR AST - open Std (BitVec) +open Ctxt (Var) namespace AliveAutoGenerated +set_option pp.proofs false +set_option pp.proofs.withType false - -namespace OnlyReturn -def lhs (w : Nat) := -[mlir_icom (w)| { -^bb0(%C1 : _): - "llvm.return" (%C1) : (_) -> () -}] - -def rhs (w : Nat):= -[mlir_icom (w)| { -^bb0(%C1 : _): - "llvm.return" (%C1) : (_) -> () -}] - -open Ctxt (Var) in -theorem refinement (w : Nat) : lhs w ⊑ rhs w := by - rw [lhs, rhs] - simp_alive_peephole - -end OnlyReturn - -- Name:AddSub:1043 -- precondition: true /- @@ -71,14 +53,3979 @@ def AddSub_1043_tgt (w : Nat):= %v7 = "llvm.sub" (%RHS,%v2) : (_, _) -> (_) "llvm.return" (%v7) : (_) -> () }] - - -set_option pp.proofs false in -set_option pp.proofs.withType false in -open Ctxt (Var) in -theorem AddSub_1043_refinement (w : Nat) : AddSub_1043_src w ⊑ AddSub_1043_tgt w := by +theorem alive_AddSub_1043 (w : Nat) : AddSub_1043_src w ⊑ AddSub_1043_tgt w := by unfold AddSub_1043_src AddSub_1043_tgt simp_alive_peephole apply bitvec_AddSub_1043 -end AliveAutoGenerated + +-- Name:AddSub:1152 +-- precondition: true +/- + %r = add i1 %x, %y + +=> + %r = xor %x, %y + +-/ +def AddSub_1152_src := +[mlir_icom ()| { +^bb0(%y : i1, %x : i1): + %v1 = "llvm.add" (%x,%y) : (i1, i1) -> (i1) + "llvm.return" (%v1) : (i1) -> () +}] + +def AddSub_1152_tgt := +[mlir_icom ()| { +^bb0(%y : i1, %x : i1): + %v1 = "llvm.xor" (%x,%y) : (i1, i1) -> (i1) + "llvm.return" (%v1) : (i1) -> () +}] +theorem alive_AddSub_1152 : AddSub_1152_src ⊑ AddSub_1152_tgt := by + unfold AddSub_1152_src AddSub_1152_tgt + simp_alive_peephole + apply bitvec_AddSub_1152 + + +-- Name:AddSub:1156 +-- precondition: true +/- + %a = add %b, %b + +=> + %a = shl %b, 1 + +-/ +def AddSub_1156_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%b : _): + %v1 = "llvm.add" (%b,%b) : (_, _) -> (_) + "llvm.return" (%v1) : (_) -> () +}] + +def AddSub_1156_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%b : _): + %v1 = "llvm.mlir.constant" () { value = 1 : _ } :() -> (_) + %v2 = "llvm.shl" (%b,%v1) : (_, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] +theorem alive_AddSub_1156 (w : Nat) : AddSub_1156_src w ⊑ AddSub_1156_tgt w := by + unfold AddSub_1156_src AddSub_1156_tgt + simp_alive_peephole + apply bitvec_AddSub_1156 + + +-- Name:AddSub:1164 +-- precondition: true +/- + %na = sub 0, %a + %c = add %na, %b + +=> + %na = sub 0, %a + %c = sub %b, %a + +-/ +def AddSub_1164_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v2 = "llvm.sub" (%v1,%a) : (_, _) -> (_) + %v3 = "llvm.add" (%v2,%b) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] + +def AddSub_1164_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v2 = "llvm.sub" (%v1,%a) : (_, _) -> (_) + %v3 = "llvm.sub" (%b,%a) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] +theorem alive_AddSub_1164 (w : Nat) : AddSub_1164_src w ⊑ AddSub_1164_tgt w := by + unfold AddSub_1164_src AddSub_1164_tgt + simp_alive_peephole + apply bitvec_AddSub_1164 + + +-- Name:AddSub:1165 +-- precondition: true +/- + %na = sub 0, %a + %nb = sub 0, %b + %c = add %na, %nb + +=> + %ab = add %a, %b + %na = sub 0, %a + %nb = sub 0, %b + %c = sub 0, %ab + +-/ +def AddSub_1165_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v2 = "llvm.sub" (%v1,%a) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v4 = "llvm.sub" (%v3,%b) : (_, _) -> (_) + %v5 = "llvm.add" (%v2,%v4) : (_, _) -> (_) + "llvm.return" (%v5) : (_) -> () +}] + +def AddSub_1165_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.add" (%a,%b) : (_, _) -> (_) + %v2 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v3 = "llvm.sub" (%v2,%a) : (_, _) -> (_) + %v4 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v5 = "llvm.sub" (%v4,%b) : (_, _) -> (_) + %v6 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v7 = "llvm.sub" (%v6,%v1) : (_, _) -> (_) + "llvm.return" (%v7) : (_) -> () +}] +theorem alive_AddSub_1165 (w : Nat) : AddSub_1165_src w ⊑ AddSub_1165_tgt w := by + unfold AddSub_1165_src AddSub_1165_tgt + simp_alive_peephole + apply bitvec_AddSub_1165 + + +-- Name:AddSub:1176 +-- precondition: true +/- + %nb = sub 0, %b + %c = add %a, %nb + +=> + %nb = sub 0, %b + %c = sub %a, %b + +-/ +def AddSub_1176_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v2 = "llvm.sub" (%v1,%b) : (_, _) -> (_) + %v3 = "llvm.add" (%a,%v2) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] + +def AddSub_1176_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v2 = "llvm.sub" (%v1,%b) : (_, _) -> (_) + %v3 = "llvm.sub" (%a,%b) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] +theorem alive_AddSub_1176 (w : Nat) : AddSub_1176_src w ⊑ AddSub_1176_tgt w := by + unfold AddSub_1176_src AddSub_1176_tgt + simp_alive_peephole + apply bitvec_AddSub_1176 + + +-- Name:AddSub:1202 +-- precondition: true +/- + %nx = xor %x, -1 + %r = add %nx, C + +=> + %nx = xor %x, -1 + %r = sub (C - 1), %x + +-/ +def AddSub_1202_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%x : _, %C : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%x,%v1) : (_, _) -> (_) + %v3 = "llvm.add" (%v2,%C) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] + +def AddSub_1202_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%x : _, %C : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%x,%v1) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = 1 : _ } :() -> (_) + %v4 = "llvm.sub" (%C,%v3) : (_, _) -> (_) + %v5 = "llvm.sub" (%v4,%x) : (_, _) -> (_) + "llvm.return" (%v5) : (_) -> () +}] +theorem alive_AddSub_1202 (w : Nat) : AddSub_1202_src w ⊑ AddSub_1202_tgt w := by + unfold AddSub_1202_src AddSub_1202_tgt + simp_alive_peephole + apply bitvec_AddSub_1202 + + +-- Name:AddSub:1295 +-- precondition: true +/- + %aab = and %a, %b + %aob = xor %a, %b + %c = add %aab, %aob + +=> + %aab = and %a, %b + %aob = xor %a, %b + %c = or %a, %b + +-/ +def AddSub_1295_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) + %v2 = "llvm.xor" (%a,%b) : (_, _) -> (_) + %v3 = "llvm.add" (%v1,%v2) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] + +def AddSub_1295_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) + %v2 = "llvm.xor" (%a,%b) : (_, _) -> (_) + %v3 = "llvm.or" (%a,%b) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] +theorem alive_AddSub_1295 (w : Nat) : AddSub_1295_src w ⊑ AddSub_1295_tgt w := by + unfold AddSub_1295_src AddSub_1295_tgt + simp_alive_peephole + apply bitvec_AddSub_1295 + + +-- Name:AddSub:1309 +-- precondition: true +/- + %lhs = and %a, %b + %rhs = or %a, %b + %c = add %lhs, %rhs + +=> + %lhs = and %a, %b + %rhs = or %a, %b + %c = add %a, %b + +-/ +def AddSub_1309_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) + %v2 = "llvm.or" (%a,%b) : (_, _) -> (_) + %v3 = "llvm.add" (%v1,%v2) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] + +def AddSub_1309_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) + %v2 = "llvm.or" (%a,%b) : (_, _) -> (_) + %v3 = "llvm.add" (%a,%b) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] +theorem alive_AddSub_1309 (w : Nat) : AddSub_1309_src w ⊑ AddSub_1309_tgt w := by + unfold AddSub_1309_src AddSub_1309_tgt + simp_alive_peephole + apply bitvec_AddSub_1309 + + +-- Name:AddSub:1539 +-- precondition: true +/- + %na = sub 0, %a + %r = sub %x, %na + +=> + %na = sub 0, %a + %r = add %x, %a + +-/ +def AddSub_1539_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%a : _, %x : _): + %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v2 = "llvm.sub" (%v1,%a) : (_, _) -> (_) + %v3 = "llvm.sub" (%x,%v2) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] + +def AddSub_1539_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%a : _, %x : _): + %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v2 = "llvm.sub" (%v1,%a) : (_, _) -> (_) + %v3 = "llvm.add" (%x,%a) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] +theorem alive_AddSub_1539 (w : Nat) : AddSub_1539_src w ⊑ AddSub_1539_tgt w := by + unfold AddSub_1539_src AddSub_1539_tgt + simp_alive_peephole + apply bitvec_AddSub_1539 + + +-- Name:AddSub:1539-2 +-- precondition: true +/- + %r = sub %x, C + +=> + %r = add %x, -C + +-/ +def AddSub_1539_2_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%x : _, %C : _): + %v1 = "llvm.sub" (%x,%C) : (_, _) -> (_) + "llvm.return" (%v1) : (_) -> () +}] + +def AddSub_1539_2_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%x : _, %C : _): + %v1 = "llvm.neg" (%C) : (_) -> (_) + %v2 = "llvm.add" (%x,%v1) : (_, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] +theorem alive_AddSub_1539_2 (w : Nat) : AddSub_1539_2_src w ⊑ AddSub_1539_2_tgt w := by + unfold AddSub_1539_2_src AddSub_1539_2_tgt + simp_alive_peephole + apply bitvec_AddSub_1539_2 + + +-- Name:AddSub:1556 +-- precondition: true +/- + %r = sub i1 %x, %y + +=> + %r = xor %x, %y + +-/ +def AddSub_1556_src := +[mlir_icom ()| { +^bb0(%y : i1, %x : i1): + %v1 = "llvm.sub" (%x,%y) : (i1, i1) -> (i1) + "llvm.return" (%v1) : (i1) -> () +}] + +def AddSub_1556_tgt := +[mlir_icom ()| { +^bb0(%y : i1, %x : i1): + %v1 = "llvm.xor" (%x,%y) : (i1, i1) -> (i1) + "llvm.return" (%v1) : (i1) -> () +}] +theorem alive_AddSub_1556 : AddSub_1556_src ⊑ AddSub_1556_tgt := by + unfold AddSub_1556_src AddSub_1556_tgt + simp_alive_peephole + apply bitvec_AddSub_1556 + + +-- Name:AddSub:1560 +-- precondition: true +/- + %r = sub -1, %a + +=> + %r = xor %a, -1 + +-/ +def AddSub_1560_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%a : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.sub" (%v1,%a) : (_, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] + +def AddSub_1560_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%a : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] +theorem alive_AddSub_1560 (w : Nat) : AddSub_1560_src w ⊑ AddSub_1560_tgt w := by + unfold AddSub_1560_src AddSub_1560_tgt + simp_alive_peephole + apply bitvec_AddSub_1560 + + +-- Name:AddSub:1564 +-- precondition: true +/- + %nx = xor %x, -1 + %r = sub C, %nx + +=> + %nx = xor %x, -1 + %r = add %x, (C + 1) + +-/ +def AddSub_1564_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%x : _, %C : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%x,%v1) : (_, _) -> (_) + %v3 = "llvm.sub" (%C,%v2) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] + +def AddSub_1564_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%x : _, %C : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%x,%v1) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = 1 : _ } :() -> (_) + %v4 = "llvm.add" (%C,%v3) : (_, _) -> (_) + %v5 = "llvm.add" (%x,%v4) : (_, _) -> (_) + "llvm.return" (%v5) : (_) -> () +}] +theorem alive_AddSub_1564 (w : Nat) : AddSub_1564_src w ⊑ AddSub_1564_tgt w := by + unfold AddSub_1564_src AddSub_1564_tgt + simp_alive_peephole + apply bitvec_AddSub_1564 + + +-- Name:AddSub:1574 +-- precondition: true +/- + %rhs = add %X, C2 + %r = sub C, %rhs + +=> + %rhs = add %X, C2 + %r = sub (C - C2), %X + +-/ +def AddSub_1574_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%X : _, %C : _, %C2 : _): + %v1 = "llvm.add" (%X,%C2) : (_, _) -> (_) + %v2 = "llvm.sub" (%C,%v1) : (_, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] + +def AddSub_1574_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%X : _, %C : _, %C2 : _): + %v1 = "llvm.add" (%X,%C2) : (_, _) -> (_) + %v2 = "llvm.sub" (%C,%C2) : (_, _) -> (_) + %v3 = "llvm.sub" (%v2,%X) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] +theorem alive_AddSub_1574 (w : Nat) : AddSub_1574_src w ⊑ AddSub_1574_tgt w := by + unfold AddSub_1574_src AddSub_1574_tgt + simp_alive_peephole + apply bitvec_AddSub_1574 + + +-- Name:AddSub:1614 +-- precondition: true +/- + %Op1 = add %X, %Y + %r = sub %X, %Op1 + +=> + %Op1 = add %X, %Y + %r = sub 0, %Y + +-/ +def AddSub_1614_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%Y : _, %X : _): + %v1 = "llvm.add" (%X,%Y) : (_, _) -> (_) + %v2 = "llvm.sub" (%X,%v1) : (_, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] + +def AddSub_1614_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%Y : _, %X : _): + %v1 = "llvm.add" (%X,%Y) : (_, _) -> (_) + %v2 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v3 = "llvm.sub" (%v2,%Y) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] +theorem alive_AddSub_1614 (w : Nat) : AddSub_1614_src w ⊑ AddSub_1614_tgt w := by + unfold AddSub_1614_src AddSub_1614_tgt + simp_alive_peephole + apply bitvec_AddSub_1614 + + +-- Name:AddSub:1619 +-- precondition: true +/- + %Op0 = sub %X, %Y + %r = sub %Op0, %X + +=> + %Op0 = sub %X, %Y + %r = sub 0, %Y + +-/ +def AddSub_1619_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%Y : _, %X : _): + %v1 = "llvm.sub" (%X,%Y) : (_, _) -> (_) + %v2 = "llvm.sub" (%v1,%X) : (_, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] + +def AddSub_1619_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%Y : _, %X : _): + %v1 = "llvm.sub" (%X,%Y) : (_, _) -> (_) + %v2 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v3 = "llvm.sub" (%v2,%Y) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] +theorem alive_AddSub_1619 (w : Nat) : AddSub_1619_src w ⊑ AddSub_1619_tgt w := by + unfold AddSub_1619_src AddSub_1619_tgt + simp_alive_peephole + apply bitvec_AddSub_1619 + + +-- Name:AddSub:1624 +-- precondition: true +/- + %Op0 = or %A, %B + %Op1 = xor %A, %B + %r = sub %Op0, %Op1 + +=> + %Op0 = or %A, %B + %Op1 = xor %A, %B + %r = and %A, %B + +-/ +def AddSub_1624_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.or" (%A,%B) : (_, _) -> (_) + %v2 = "llvm.xor" (%A,%B) : (_, _) -> (_) + %v3 = "llvm.sub" (%v1,%v2) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] + +def AddSub_1624_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.or" (%A,%B) : (_, _) -> (_) + %v2 = "llvm.xor" (%A,%B) : (_, _) -> (_) + %v3 = "llvm.and" (%A,%B) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] +theorem alive_AddSub_1624 (w : Nat) : AddSub_1624_src w ⊑ AddSub_1624_tgt w := by + unfold AddSub_1624_src AddSub_1624_tgt + simp_alive_peephole + apply bitvec_AddSub_1624 + + +-- Name:AndOrXor:135 +-- precondition: true +/- + %op = xor %X, C1 + %r = and %op, C2 + +=> + %a = and %X, C2 + %op = xor %X, C1 + %r = xor %a, (C1 & C2) + +-/ +def AndOrXor_135_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%X : _, %C1 : _, %C2 : _): + %v1 = "llvm.xor" (%X,%C1) : (_, _) -> (_) + %v2 = "llvm.and" (%v1,%C2) : (_, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] + +def AndOrXor_135_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%X : _, %C1 : _, %C2 : _): + %v1 = "llvm.and" (%X,%C2) : (_, _) -> (_) + %v2 = "llvm.xor" (%X,%C1) : (_, _) -> (_) + %v3 = "llvm.and" (%C1,%C2) : (_, _) -> (_) + %v4 = "llvm.xor" (%v1,%v3) : (_, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] +theorem alive_AndOrXor_135 (w : Nat) : AndOrXor_135_src w ⊑ AndOrXor_135_tgt w := by + unfold AndOrXor_135_src AndOrXor_135_tgt + simp_alive_peephole + apply bitvec_AndOrXor_135 + + +-- Name:AndOrXor:144 +-- precondition: true +/- + %op = or %X, C1 + %r = and %op, C2 + +=> + %o = or %X, (C1 & C2) + %op = or %X, C1 + %r = and %o, C2 + +-/ +def AndOrXor_144_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%X : _, %C1 : _, %C2 : _): + %v1 = "llvm.or" (%X,%C1) : (_, _) -> (_) + %v2 = "llvm.and" (%v1,%C2) : (_, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] + +def AndOrXor_144_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%X : _, %C1 : _, %C2 : _): + %v1 = "llvm.and" (%C1,%C2) : (_, _) -> (_) + %v2 = "llvm.or" (%X,%v1) : (_, _) -> (_) + %v3 = "llvm.or" (%X,%C1) : (_, _) -> (_) + %v4 = "llvm.and" (%v2,%C2) : (_, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] +theorem alive_AndOrXor_144 (w : Nat) : AndOrXor_144_src w ⊑ AndOrXor_144_tgt w := by + unfold AndOrXor_144_src AndOrXor_144_tgt + simp_alive_peephole + apply bitvec_AndOrXor_144 + + +-- Name:AndOrXor:698 +-- precondition: true +/- + %a1 = and %a, %b + %a2 = and %a, %d + %op0 = icmp eq %a1, 0 + %op1 = icmp eq %a2, 0 + %r = and %op0, %op1 + +=> + %or = or %b, %d + %a3 = and %a, %or + %a1 = and %a, %b + %a2 = and %a, %d + %op0 = icmp eq %a1, 0 + %op1 = icmp eq %a2, 0 + %r = icmp eq %a3, 0 + +-/ +def AndOrXor_698_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%a : _, %b : _, %d : _): + %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) + %v2 = "llvm.and" (%a,%d) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v4 = "llvm.icmp eq " (%v1,%v3) : (_, _) -> (_) + %v5 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v6 = "llvm.icmp eq " (%v2,%v5) : (_, _) -> (_) + %v7 = "llvm.and" (%v4,%v6) : (_, _) -> (i1) + "llvm.return" (%v7) : (i1) -> () +}] + +def AndOrXor_698_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%a : _, %b : _, %d : _): + %v1 = "llvm.or" (%b,%d) : (_, _) -> (_) + %v2 = "llvm.and" (%a,%v1) : (_, _) -> (_) + %v3 = "llvm.and" (%a,%b) : (_, _) -> (_) + %v4 = "llvm.and" (%a,%d) : (_, _) -> (_) + %v5 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v6 = "llvm.icmp eq " (%v3,%v5) : (_, _) -> (_) + %v7 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v8 = "llvm.icmp eq " (%v4,%v7) : (_, _) -> (_) + %v9 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v10 = "llvm.icmp eq " (%v2,%v9) : (_, _) -> (_) + "llvm.return" (%v10) : (i1) -> () +}] +theorem alive_AndOrXor_698 : AndOrXor_698_src ⊑ AndOrXor_698_tgt := by + unfold AndOrXor_698_src AndOrXor_698_tgt + simp_alive_peephole + apply bitvec_AndOrXor_698 + + +-- Name:AndOrXor:709 +-- precondition: true +/- + %a1 = and %a, %b + %a2 = and %a, %d + %op0 = icmp eq %a1, %b + %op1 = icmp eq %a2, %d + %r = and %op0, %op1 + +=> + %or = or %b, %d + %a3 = and %a, %or + %a1 = and %a, %b + %a2 = and %a, %d + %op0 = icmp eq %a1, %b + %op1 = icmp eq %a2, %d + %r = icmp eq %a3, %or + +-/ +def AndOrXor_709_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%a : _, %b : _, %d : _): + %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) + %v2 = "llvm.and" (%a,%d) : (_, _) -> (_) + %v3 = "llvm.icmp eq " (%v1,%b) : (_, _) -> (_) + %v4 = "llvm.icmp eq " (%v2,%d) : (_, _) -> (_) + %v5 = "llvm.and" (%v3,%v4) : (_, _) -> (i1) + "llvm.return" (%v5) : (i1) -> () +}] + +def AndOrXor_709_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%a : _, %b : _, %d : _): + %v1 = "llvm.or" (%b,%d) : (_, _) -> (_) + %v2 = "llvm.and" (%a,%v1) : (_, _) -> (_) + %v3 = "llvm.and" (%a,%b) : (_, _) -> (_) + %v4 = "llvm.and" (%a,%d) : (_, _) -> (_) + %v5 = "llvm.icmp eq " (%v3,%b) : (_, _) -> (_) + %v6 = "llvm.icmp eq " (%v4,%d) : (_, _) -> (_) + %v7 = "llvm.icmp eq " (%v2,%v1) : (_, _) -> (_) + "llvm.return" (%v7) : (i1) -> () +}] +theorem alive_AndOrXor_709 : AndOrXor_709_src ⊑ AndOrXor_709_tgt := by + unfold AndOrXor_709_src AndOrXor_709_tgt + simp_alive_peephole + apply bitvec_AndOrXor_709 + + +-- Name:AndOrXor:716 +-- precondition: true +/- + %a1 = and %a, %b + %a2 = and %a, %d + %op0 = icmp eq %a1, %a + %op1 = icmp eq %a2, %a + %r = and %op0, %op1 + +=> + %a4 = and %b, %d + %a3 = and %a, %a4 + %a1 = and %a, %b + %a2 = and %a, %d + %op0 = icmp eq %a1, %a + %op1 = icmp eq %a2, %a + %r = icmp eq %a3, %a + +-/ +def AndOrXor_716_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%a : _, %b : _, %d : _): + %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) + %v2 = "llvm.and" (%a,%d) : (_, _) -> (_) + %v3 = "llvm.icmp eq " (%v1,%a) : (_, _) -> (_) + %v4 = "llvm.icmp eq " (%v2,%a) : (_, _) -> (_) + %v5 = "llvm.and" (%v3,%v4) : (_, _) -> (i1) + "llvm.return" (%v5) : (i1) -> () +}] + +def AndOrXor_716_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%a : _, %b : _, %d : _): + %v1 = "llvm.and" (%b,%d) : (_, _) -> (_) + %v2 = "llvm.and" (%a,%v1) : (_, _) -> (_) + %v3 = "llvm.and" (%a,%b) : (_, _) -> (_) + %v4 = "llvm.and" (%a,%d) : (_, _) -> (_) + %v5 = "llvm.icmp eq " (%v3,%a) : (_, _) -> (_) + %v6 = "llvm.icmp eq " (%v4,%a) : (_, _) -> (_) + %v7 = "llvm.icmp eq " (%v2,%a) : (_, _) -> (_) + "llvm.return" (%v7) : (i1) -> () +}] +theorem alive_AndOrXor_716 : AndOrXor_716_src ⊑ AndOrXor_716_tgt := by + unfold AndOrXor_716_src AndOrXor_716_tgt + simp_alive_peephole + apply bitvec_AndOrXor_716 + + +-- Name:AndOrXor:794 +-- precondition: true +/- + %op0 = icmp sgt %a, %b + %op1 = icmp ne %a, %b + %r = and %op0, %op1 + +=> + %op0 = icmp sgt %a, %b + %op1 = icmp ne %a, %b + %r = icmp sgt %a, %b + +-/ +def AndOrXor_794_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.icmp sgt " (%a,%b) : (_, _) -> (_) + %v2 = "llvm.icmp ne " (%a,%b) : (_, _) -> (_) + %v3 = "llvm.and" (%v1,%v2) : (_, _) -> (i1) + "llvm.return" (%v3) : (i1) -> () +}] + +def AndOrXor_794_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.icmp sgt " (%a,%b) : (_, _) -> (_) + %v2 = "llvm.icmp ne " (%a,%b) : (_, _) -> (_) + %v3 = "llvm.icmp sgt " (%a,%b) : (_, _) -> (_) + "llvm.return" (%v3) : (i1) -> () +}] +theorem alive_AndOrXor_794 : AndOrXor_794_src ⊑ AndOrXor_794_tgt := by + unfold AndOrXor_794_src AndOrXor_794_tgt + simp_alive_peephole + apply bitvec_AndOrXor_794 + + +-- Name:AndOrXor:827 +-- precondition: true +/- + %op0 = icmp eq %a, 0 + %op1 = icmp eq %b, 0 + %r = and %op0, %op1 + +=> + %o = or %a, %b + %op0 = icmp eq %a, 0 + %op1 = icmp eq %b, 0 + %r = icmp eq %o, 0 + +-/ +def AndOrXor_827_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v2 = "llvm.icmp eq " (%a,%v1) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v4 = "llvm.icmp eq " (%b,%v3) : (_, _) -> (_) + %v5 = "llvm.and" (%v2,%v4) : (_, _) -> (i1) + "llvm.return" (%v5) : (i1) -> () +}] + +def AndOrXor_827_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.or" (%a,%b) : (_, _) -> (_) + %v2 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v3 = "llvm.icmp eq " (%a,%v2) : (_, _) -> (_) + %v4 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v5 = "llvm.icmp eq " (%b,%v4) : (_, _) -> (_) + %v6 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v7 = "llvm.icmp eq " (%v1,%v6) : (_, _) -> (_) + "llvm.return" (%v7) : (i1) -> () +}] +theorem alive_AndOrXor_827 : AndOrXor_827_src ⊑ AndOrXor_827_tgt := by + unfold AndOrXor_827_src AndOrXor_827_tgt + simp_alive_peephole + apply bitvec_AndOrXor_827 + + +-- Name:AndOrXor:887-2 +-- precondition: true +/- + %op0 = icmp eq %a, C1 + %op1 = icmp ne %a, C1 + %r = and %op0, %op1 + +=> + %op0 = icmp eq %a, C1 + %op1 = icmp ne %a, C1 + %r = false + +-/ +def AndOrXor_887_2_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%a : _, %C1 : _): + %v1 = "llvm.icmp eq " (%a,%C1) : (_, _) -> (_) + %v2 = "llvm.icmp ne " (%a,%C1) : (_, _) -> (_) + %v3 = "llvm.and" (%v1,%v2) : (_, _) -> (i1) + "llvm.return" (%v3) : (i1) -> () +}] + +def AndOrXor_887_2_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%a : _, %C1 : _): + %v1 = "llvm.icmp eq " (%a,%C1) : (_, _) -> (_) + %v2 = "llvm.icmp ne " (%a,%C1) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = 0 : 1 } :() -> (i1) + %v4 = "llvm.copy" (%v3) : (i1) -> (i1) + "llvm.return" (%v4) : (i1) -> () +}] +theorem alive_AndOrXor_887_2 : AndOrXor_887_2_src ⊑ AndOrXor_887_2_tgt := by + unfold AndOrXor_887_2_src AndOrXor_887_2_tgt + simp_alive_peephole + apply bitvec_AndOrXor_887_2 + + +-- Name:AndOrXor:1230 ~A & ~B -> ~(A | B) +-- precondition: true +/- + %op0 = xor %notOp0, -1 + %op1 = xor %notOp1, -1 + %r = and %op0, %op1 + +=> + %or = or %notOp0, %notOp1 + %op0 = xor %notOp0, -1 + %op1 = xor %notOp1, -1 + %r = xor %or, -1 + +-/ +def AndOrXor_1230__A__B___A__B_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%notOp0 : _, %notOp1 : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%notOp0,%v1) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v4 = "llvm.xor" (%notOp1,%v3) : (_, _) -> (_) + %v5 = "llvm.and" (%v2,%v4) : (_, _) -> (_) + "llvm.return" (%v5) : (_) -> () +}] + +def AndOrXor_1230__A__B___A__B_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%notOp0 : _, %notOp1 : _): + %v1 = "llvm.or" (%notOp0,%notOp1) : (_, _) -> (_) + %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v3 = "llvm.xor" (%notOp0,%v2) : (_, _) -> (_) + %v4 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v5 = "llvm.xor" (%notOp1,%v4) : (_, _) -> (_) + %v6 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v7 = "llvm.xor" (%v1,%v6) : (_, _) -> (_) + "llvm.return" (%v7) : (_) -> () +}] +theorem alive_AndOrXor_1230__A__B___A__B (w : Nat) : AndOrXor_1230__A__B___A__B_src w ⊑ AndOrXor_1230__A__B___A__B_tgt w := by + unfold AndOrXor_1230__A__B___A__B_src AndOrXor_1230__A__B___A__B_tgt + simp_alive_peephole + apply bitvec_AndOrXor_1230__A__B___A__B + + +-- Name:AndOrXor:1241 (A|B) & ~(A&B) => A^B +-- precondition: true +/- + %op0 = or %A, %B + %notOp1 = and %A, %B + %op1 = xor %notOp1, -1 + %r = and %op0, %op1 + +=> + %op0 = or %A, %B + %notOp1 = and %A, %B + %op1 = xor %notOp1, -1 + %r = xor %A, %B + +-/ +def AndOrXor_1241_AB__AB__AB_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.or" (%A,%B) : (_, _) -> (_) + %v2 = "llvm.and" (%A,%B) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v4 = "llvm.xor" (%v2,%v3) : (_, _) -> (_) + %v5 = "llvm.and" (%v1,%v4) : (_, _) -> (_) + "llvm.return" (%v5) : (_) -> () +}] + +def AndOrXor_1241_AB__AB__AB_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.or" (%A,%B) : (_, _) -> (_) + %v2 = "llvm.and" (%A,%B) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v4 = "llvm.xor" (%v2,%v3) : (_, _) -> (_) + %v5 = "llvm.xor" (%A,%B) : (_, _) -> (_) + "llvm.return" (%v5) : (_) -> () +}] +theorem alive_AndOrXor_1241_AB__AB__AB (w : Nat) : AndOrXor_1241_AB__AB__AB_src w ⊑ AndOrXor_1241_AB__AB__AB_tgt w := by + unfold AndOrXor_1241_AB__AB__AB_src AndOrXor_1241_AB__AB__AB_tgt + simp_alive_peephole + apply bitvec_AndOrXor_1241_AB__AB__AB + + +-- Name:AndOrXor:1247 ~(A&B) & (A|B) => A^B +-- precondition: true +/- + %notOp0 = and %A, %B + %op0 = xor %notOp0, -1 + %op1 = or %A, %B + %r = and %op0, %op1 + +=> + %notOp0 = and %A, %B + %op0 = xor %notOp0, -1 + %op1 = or %A, %B + %r = xor %A, %B + +-/ +def AndOrXor_1247_AB__AB__AB_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.and" (%A,%B) : (_, _) -> (_) + %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v3 = "llvm.xor" (%v1,%v2) : (_, _) -> (_) + %v4 = "llvm.or" (%A,%B) : (_, _) -> (_) + %v5 = "llvm.and" (%v3,%v4) : (_, _) -> (_) + "llvm.return" (%v5) : (_) -> () +}] + +def AndOrXor_1247_AB__AB__AB_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.and" (%A,%B) : (_, _) -> (_) + %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v3 = "llvm.xor" (%v1,%v2) : (_, _) -> (_) + %v4 = "llvm.or" (%A,%B) : (_, _) -> (_) + %v5 = "llvm.xor" (%A,%B) : (_, _) -> (_) + "llvm.return" (%v5) : (_) -> () +}] +theorem alive_AndOrXor_1247_AB__AB__AB (w : Nat) : AndOrXor_1247_AB__AB__AB_src w ⊑ AndOrXor_1247_AB__AB__AB_tgt w := by + unfold AndOrXor_1247_AB__AB__AB_src AndOrXor_1247_AB__AB__AB_tgt + simp_alive_peephole + apply bitvec_AndOrXor_1247_AB__AB__AB + + +-- Name:AndOrXor:1253 A & (A^B) -> A & ~B +-- precondition: true +/- + %op0 = xor %A, %B + %r = and %op0, %A + +=> + %notB = xor %B, -1 + %op0 = xor %A, %B + %r = and %A, %notB + +-/ +def AndOrXor_1253_A__AB___A__B_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.xor" (%A,%B) : (_, _) -> (_) + %v2 = "llvm.and" (%v1,%A) : (_, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] + +def AndOrXor_1253_A__AB___A__B_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%B,%v1) : (_, _) -> (_) + %v3 = "llvm.xor" (%A,%B) : (_, _) -> (_) + %v4 = "llvm.and" (%A,%v2) : (_, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] +theorem alive_AndOrXor_1253_A__AB___A__B (w : Nat) : AndOrXor_1253_A__AB___A__B_src w ⊑ AndOrXor_1253_A__AB___A__B_tgt w := by + unfold AndOrXor_1253_A__AB___A__B_src AndOrXor_1253_A__AB___A__B_tgt + simp_alive_peephole + apply bitvec_AndOrXor_1253_A__AB___A__B + + +-- Name:AndOrXor:1280 (~A|B)&A -> A&B +-- precondition: true +/- + %nA = xor %A, -1 + %op0 = or %nA, %B + %r = and %op0, %A + +=> + %nA = xor %A, -1 + %op0 = or %nA, %B + %r = and %A, %B + +-/ +def AndOrXor_1280_ABA___AB_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%A,%v1) : (_, _) -> (_) + %v3 = "llvm.or" (%v2,%B) : (_, _) -> (_) + %v4 = "llvm.and" (%v3,%A) : (_, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] + +def AndOrXor_1280_ABA___AB_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%A,%v1) : (_, _) -> (_) + %v3 = "llvm.or" (%v2,%B) : (_, _) -> (_) + %v4 = "llvm.and" (%A,%B) : (_, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] +theorem alive_AndOrXor_1280_ABA___AB (w : Nat) : AndOrXor_1280_ABA___AB_src w ⊑ AndOrXor_1280_ABA___AB_tgt w := by + unfold AndOrXor_1280_ABA___AB_src AndOrXor_1280_ABA___AB_tgt + simp_alive_peephole + apply bitvec_AndOrXor_1280_ABA___AB + + +-- Name:AndOrXor:1288 (A ^ B) & ((B ^ C) ^ A) -> (A ^ B) & ~C +-- precondition: true +/- + %op0 = xor %A, %B + %x = xor %B, %C + %op1 = xor %x, %A + %r = and %op0, %op1 + +=> + %op0 = xor %A, %B + %negC = xor %C, -1 + %x = xor %B, %C + %op1 = xor %x, %A + %r = and %op0, %negC + +-/ +def AndOrXor_1288_A__B__B__C__A___A__B__C_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _, %C : _, %B : _): + %v1 = "llvm.xor" (%A,%B) : (_, _) -> (_) + %v2 = "llvm.xor" (%B,%C) : (_, _) -> (_) + %v3 = "llvm.xor" (%v2,%A) : (_, _) -> (_) + %v4 = "llvm.and" (%v1,%v3) : (_, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] + +def AndOrXor_1288_A__B__B__C__A___A__B__C_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _, %C : _, %B : _): + %v1 = "llvm.xor" (%A,%B) : (_, _) -> (_) + %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v3 = "llvm.xor" (%C,%v2) : (_, _) -> (_) + %v4 = "llvm.xor" (%B,%C) : (_, _) -> (_) + %v5 = "llvm.xor" (%v4,%A) : (_, _) -> (_) + %v6 = "llvm.and" (%v1,%v3) : (_, _) -> (_) + "llvm.return" (%v6) : (_) -> () +}] +theorem alive_AndOrXor_1288_A__B__B__C__A___A__B__C (w : Nat) : AndOrXor_1288_A__B__B__C__A___A__B__C_src w ⊑ AndOrXor_1288_A__B__B__C__A___A__B__C_tgt w := by + unfold AndOrXor_1288_A__B__B__C__A___A__B__C_src AndOrXor_1288_A__B__B__C__A___A__B__C_tgt + simp_alive_peephole + apply bitvec_AndOrXor_1288_A__B__B__C__A___A__B__C + + +-- Name:AndOrXor:1294 (A | B) & ((~A) ^ B) -> (A & B) +-- precondition: true +/- + %op0 = or %A, %B + %x = xor %A, -1 + %op1 = xor %x, %B + %r = and %op0, %op1 + +=> + %op0 = or %A, %B + %x = xor %A, -1 + %op1 = xor %x, %B + %r = and %A, %B + +-/ +def AndOrXor_1294_A__B__A__B___A__B_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.or" (%A,%B) : (_, _) -> (_) + %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v3 = "llvm.xor" (%A,%v2) : (_, _) -> (_) + %v4 = "llvm.xor" (%v3,%B) : (_, _) -> (_) + %v5 = "llvm.and" (%v1,%v4) : (_, _) -> (_) + "llvm.return" (%v5) : (_) -> () +}] + +def AndOrXor_1294_A__B__A__B___A__B_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.or" (%A,%B) : (_, _) -> (_) + %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v3 = "llvm.xor" (%A,%v2) : (_, _) -> (_) + %v4 = "llvm.xor" (%v3,%B) : (_, _) -> (_) + %v5 = "llvm.and" (%A,%B) : (_, _) -> (_) + "llvm.return" (%v5) : (_) -> () +}] +theorem alive_AndOrXor_1294_A__B__A__B___A__B (w : Nat) : AndOrXor_1294_A__B__A__B___A__B_src w ⊑ AndOrXor_1294_A__B__A__B___A__B_tgt w := by + unfold AndOrXor_1294_A__B__A__B___A__B_src AndOrXor_1294_A__B__A__B___A__B_tgt + simp_alive_peephole + apply bitvec_AndOrXor_1294_A__B__A__B___A__B + + +-- Name:AndOrXor:1683-1 +-- precondition: true +/- + %op0 = icmp ugt %a, %b + %op1 = icmp eq %a, %b + %r = or %op0, %op1 + +=> + %op0 = icmp ugt %a, %b + %op1 = icmp eq %a, %b + %r = icmp uge %a, %b + +-/ +def AndOrXor_1683_1_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.icmp ugt " (%a,%b) : (_, _) -> (_) + %v2 = "llvm.icmp eq " (%a,%b) : (_, _) -> (_) + %v3 = "llvm.or" (%v1,%v2) : (_, _) -> (i1) + "llvm.return" (%v3) : (i1) -> () +}] + +def AndOrXor_1683_1_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.icmp ugt " (%a,%b) : (_, _) -> (_) + %v2 = "llvm.icmp eq " (%a,%b) : (_, _) -> (_) + %v3 = "llvm.icmp uge " (%a,%b) : (_, _) -> (_) + "llvm.return" (%v3) : (i1) -> () +}] +theorem alive_AndOrXor_1683_1 : AndOrXor_1683_1_src ⊑ AndOrXor_1683_1_tgt := by + unfold AndOrXor_1683_1_src AndOrXor_1683_1_tgt + simp_alive_peephole + apply bitvec_AndOrXor_1683_1 + + +-- Name:AndOrXor:1683-2 +-- precondition: true +/- + %op0 = icmp uge %a, %b + %op1 = icmp ne %a, %b + %r = or %op0, %op1 + +=> + %op0 = icmp uge %a, %b + %op1 = icmp ne %a, %b + %r = true + +-/ +def AndOrXor_1683_2_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.icmp uge " (%a,%b) : (_, _) -> (_) + %v2 = "llvm.icmp ne " (%a,%b) : (_, _) -> (_) + %v3 = "llvm.or" (%v1,%v2) : (_, _) -> (i1) + "llvm.return" (%v3) : (i1) -> () +}] + +def AndOrXor_1683_2_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.icmp uge " (%a,%b) : (_, _) -> (_) + %v2 = "llvm.icmp ne " (%a,%b) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = 1 : 1 } :() -> (i1) + %v4 = "llvm.copy" (%v3) : (i1) -> (i1) + "llvm.return" (%v4) : (i1) -> () +}] +theorem alive_AndOrXor_1683_2 : AndOrXor_1683_2_src ⊑ AndOrXor_1683_2_tgt := by + unfold AndOrXor_1683_2_src AndOrXor_1683_2_tgt + simp_alive_peephole + apply bitvec_AndOrXor_1683_2 + + +-- Name:AndOrXor:1704 +-- precondition: true +/- + %cmp1 = icmp eq %B, 0 + %cmp2 = icmp ult %A, %B + %r = or %cmp1, %cmp2 + +=> + %b1 = add %B, -1 + %cmp1 = icmp eq %B, 0 + %cmp2 = icmp ult %A, %B + %r = icmp uge %b1, %A + +-/ +def AndOrXor_1704_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v2 = "llvm.icmp eq " (%B,%v1) : (_, _) -> (_) + %v3 = "llvm.icmp ult " (%A,%B) : (_, _) -> (_) + %v4 = "llvm.or" (%v2,%v3) : (_, _) -> (i1) + "llvm.return" (%v4) : (i1) -> () +}] + +def AndOrXor_1704_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.add" (%B,%v1) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v4 = "llvm.icmp eq " (%B,%v3) : (_, _) -> (_) + %v5 = "llvm.icmp ult " (%A,%B) : (_, _) -> (_) + %v6 = "llvm.icmp uge " (%v2,%A) : (_, _) -> (_) + "llvm.return" (%v6) : (i1) -> () +}] +theorem alive_AndOrXor_1704 : AndOrXor_1704_src ⊑ AndOrXor_1704_tgt := by + unfold AndOrXor_1704_src AndOrXor_1704_tgt + simp_alive_peephole + apply bitvec_AndOrXor_1704 + + +-- Name:AndOrXor:1705 +-- precondition: true +/- + %cmp1 = icmp eq %B, 0 + %cmp2 = icmp ugt %B, %A + %r = or %cmp1, %cmp2 + +=> + %b1 = add %B, -1 + %cmp1 = icmp eq %B, 0 + %cmp2 = icmp ugt %B, %A + %r = icmp uge %b1, %A + +-/ +def AndOrXor_1705_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v2 = "llvm.icmp eq " (%B,%v1) : (_, _) -> (_) + %v3 = "llvm.icmp ugt " (%B,%A) : (_, _) -> (_) + %v4 = "llvm.or" (%v2,%v3) : (_, _) -> (i1) + "llvm.return" (%v4) : (i1) -> () +}] + +def AndOrXor_1705_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.add" (%B,%v1) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v4 = "llvm.icmp eq " (%B,%v3) : (_, _) -> (_) + %v5 = "llvm.icmp ugt " (%B,%A) : (_, _) -> (_) + %v6 = "llvm.icmp uge " (%v2,%A) : (_, _) -> (_) + "llvm.return" (%v6) : (i1) -> () +}] +theorem alive_AndOrXor_1705 : AndOrXor_1705_src ⊑ AndOrXor_1705_tgt := by + unfold AndOrXor_1705_src AndOrXor_1705_tgt + simp_alive_peephole + apply bitvec_AndOrXor_1705 + + +-- Name:AndOrXor:1733 +-- precondition: true +/- + %cmp1 = icmp ne %A, 0 + %cmp2 = icmp ne %B, 0 + %r = or %cmp1, %cmp2 + +=> + %or = or %A, %B + %cmp1 = icmp ne %A, 0 + %cmp2 = icmp ne %B, 0 + %r = icmp ne %or, 0 + +-/ +def AndOrXor_1733_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v2 = "llvm.icmp ne " (%A,%v1) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v4 = "llvm.icmp ne " (%B,%v3) : (_, _) -> (_) + %v5 = "llvm.or" (%v2,%v4) : (_, _) -> (i1) + "llvm.return" (%v5) : (i1) -> () +}] + +def AndOrXor_1733_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.or" (%A,%B) : (_, _) -> (_) + %v2 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v3 = "llvm.icmp ne " (%A,%v2) : (_, _) -> (_) + %v4 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v5 = "llvm.icmp ne " (%B,%v4) : (_, _) -> (_) + %v6 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v7 = "llvm.icmp ne " (%v1,%v6) : (_, _) -> (_) + "llvm.return" (%v7) : (i1) -> () +}] +theorem alive_AndOrXor_1733 : AndOrXor_1733_src ⊑ AndOrXor_1733_tgt := by + unfold AndOrXor_1733_src AndOrXor_1733_tgt + simp_alive_peephole + apply bitvec_AndOrXor_1733 + + +-- Name:AndOrXor:2063 (X ^ C1) | C2 --> (X | C2) ^ (C1 & ~C2) +-- precondition: true +/- + %op0 = xor %x, C1 + %r = or %op0, C + +=> + %or = or %x, C + %op0 = xor %x, C1 + %r = xor %or, (C1 & ~C) + +-/ +def AndOrXor_2063__X__C1__C2____X__C2__C1__C2_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%x : _, %C1 : _, %C : _): + %v1 = "llvm.xor" (%x,%C1) : (_, _) -> (_) + %v2 = "llvm.or" (%v1,%C) : (_, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] + +def AndOrXor_2063__X__C1__C2____X__C2__C1__C2_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%x : _, %C1 : _, %C : _): + %v1 = "llvm.or" (%x,%C) : (_, _) -> (_) + %v2 = "llvm.xor" (%x,%C1) : (_, _) -> (_) + %v3 = "llvm.not" (%C) : (_) -> (_) + %v4 = "llvm.and" (%C1,%v3) : (_, _) -> (_) + %v5 = "llvm.xor" (%v1,%v4) : (_, _) -> (_) + "llvm.return" (%v5) : (_) -> () +}] +theorem alive_AndOrXor_2063__X__C1__C2____X__C2__C1__C2 (w : Nat) : AndOrXor_2063__X__C1__C2____X__C2__C1__C2_src w ⊑ AndOrXor_2063__X__C1__C2____X__C2__C1__C2_tgt w := by + unfold AndOrXor_2063__X__C1__C2____X__C2__C1__C2_src AndOrXor_2063__X__C1__C2____X__C2__C1__C2_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2063__X__C1__C2____X__C2__C1__C2 + + +-- Name:AndOrXor:2113 ((~A & B) | A) -> (A | B) +-- precondition: true +/- + %negA = xor %A, -1 + %op0 = and %negA, %B + %r = or %op0, %A + +=> + %negA = xor %A, -1 + %op0 = and %negA, %B + %r = or %A, %B + +-/ +def AndOrXor_2113___A__B__A___A__B_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%A,%v1) : (_, _) -> (_) + %v3 = "llvm.and" (%v2,%B) : (_, _) -> (_) + %v4 = "llvm.or" (%v3,%A) : (_, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] + +def AndOrXor_2113___A__B__A___A__B_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%A,%v1) : (_, _) -> (_) + %v3 = "llvm.and" (%v2,%B) : (_, _) -> (_) + %v4 = "llvm.or" (%A,%B) : (_, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] +theorem alive_AndOrXor_2113___A__B__A___A__B (w : Nat) : AndOrXor_2113___A__B__A___A__B_src w ⊑ AndOrXor_2113___A__B__A___A__B_tgt w := by + unfold AndOrXor_2113___A__B__A___A__B_src AndOrXor_2113___A__B__A___A__B_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2113___A__B__A___A__B + + +-- Name:AndOrXor:2118 ((A & B) | ~A) -> (~A | B) +-- precondition: true +/- + %negA = xor %A, -1 + %op0 = and %A, %B + %r = or %op0, %negA + +=> + %negA = xor %A, -1 + %op0 = and %A, %B + %r = or %negA, %B + +-/ +def AndOrXor_2118___A__B__A___A__B_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%A,%v1) : (_, _) -> (_) + %v3 = "llvm.and" (%A,%B) : (_, _) -> (_) + %v4 = "llvm.or" (%v3,%v2) : (_, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] + +def AndOrXor_2118___A__B__A___A__B_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%A,%v1) : (_, _) -> (_) + %v3 = "llvm.and" (%A,%B) : (_, _) -> (_) + %v4 = "llvm.or" (%v2,%B) : (_, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] +theorem alive_AndOrXor_2118___A__B__A___A__B (w : Nat) : AndOrXor_2118___A__B__A___A__B_src w ⊑ AndOrXor_2118___A__B__A___A__B_tgt w := by + unfold AndOrXor_2118___A__B__A___A__B_src AndOrXor_2118___A__B__A___A__B_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2118___A__B__A___A__B + + +-- Name:AndOrXor:2123 (A & (~B)) | (A ^ B) -> (A ^ B) +-- precondition: true +/- + %negB = xor %B, -1 + %op0 = and %A, %negB + %op1 = xor %A, %B + %r = or %op0, %op1 + +=> + %negB = xor %B, -1 + %op0 = and %A, %negB + %op1 = xor %A, %B + %r = xor %A, %B + +-/ +def AndOrXor_2123___A__B__A__B___A__B_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%B,%v1) : (_, _) -> (_) + %v3 = "llvm.and" (%A,%v2) : (_, _) -> (_) + %v4 = "llvm.xor" (%A,%B) : (_, _) -> (_) + %v5 = "llvm.or" (%v3,%v4) : (_, _) -> (_) + "llvm.return" (%v5) : (_) -> () +}] + +def AndOrXor_2123___A__B__A__B___A__B_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%B,%v1) : (_, _) -> (_) + %v3 = "llvm.and" (%A,%v2) : (_, _) -> (_) + %v4 = "llvm.xor" (%A,%B) : (_, _) -> (_) + %v5 = "llvm.xor" (%A,%B) : (_, _) -> (_) + "llvm.return" (%v5) : (_) -> () +}] +theorem alive_AndOrXor_2123___A__B__A__B___A__B (w : Nat) : AndOrXor_2123___A__B__A__B___A__B_src w ⊑ AndOrXor_2123___A__B__A__B___A__B_tgt w := by + unfold AndOrXor_2123___A__B__A__B___A__B_src AndOrXor_2123___A__B__A__B___A__B_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2123___A__B__A__B___A__B + + +-- Name:AndOrXor:2188 +-- precondition: true +/- + %C = xor %D, -1 + %B = xor %A, -1 + %op0 = and %A, %C + %op1 = and %B, %D + %r = or %op0, %op1 + +=> + %C = xor %D, -1 + %B = xor %A, -1 + %op0 = and %A, %C + %op1 = and %B, %D + %r = xor %A, %D + +-/ +def AndOrXor_2188_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _, %D : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%D,%v1) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v4 = "llvm.xor" (%A,%v3) : (_, _) -> (_) + %v5 = "llvm.and" (%A,%v2) : (_, _) -> (_) + %v6 = "llvm.and" (%v4,%D) : (_, _) -> (_) + %v7 = "llvm.or" (%v5,%v6) : (_, _) -> (_) + "llvm.return" (%v7) : (_) -> () +}] + +def AndOrXor_2188_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _, %D : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%D,%v1) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v4 = "llvm.xor" (%A,%v3) : (_, _) -> (_) + %v5 = "llvm.and" (%A,%v2) : (_, _) -> (_) + %v6 = "llvm.and" (%v4,%D) : (_, _) -> (_) + %v7 = "llvm.xor" (%A,%D) : (_, _) -> (_) + "llvm.return" (%v7) : (_) -> () +}] +theorem alive_AndOrXor_2188 (w : Nat) : AndOrXor_2188_src w ⊑ AndOrXor_2188_tgt w := by + unfold AndOrXor_2188_src AndOrXor_2188_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2188 + + +-- Name:AndOrXor:2231 (A ^ B) | ((B ^ C) ^ A) -> (A ^ B) | C +-- precondition: true +/- + %op0 = xor %A, %B + %x = xor %B, %C + %op1 = xor %x, %A + %r = or %op0, %op1 + +=> + %op0 = xor %A, %B + %x = xor %B, %C + %op1 = xor %x, %A + %r = or %op0, %C + +-/ +def AndOrXor_2231__A__B__B__C__A___A__B__C_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _, %C : _, %B : _): + %v1 = "llvm.xor" (%A,%B) : (_, _) -> (_) + %v2 = "llvm.xor" (%B,%C) : (_, _) -> (_) + %v3 = "llvm.xor" (%v2,%A) : (_, _) -> (_) + %v4 = "llvm.or" (%v1,%v3) : (_, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] + +def AndOrXor_2231__A__B__B__C__A___A__B__C_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _, %C : _, %B : _): + %v1 = "llvm.xor" (%A,%B) : (_, _) -> (_) + %v2 = "llvm.xor" (%B,%C) : (_, _) -> (_) + %v3 = "llvm.xor" (%v2,%A) : (_, _) -> (_) + %v4 = "llvm.or" (%v1,%C) : (_, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] +theorem alive_AndOrXor_2231__A__B__B__C__A___A__B__C (w : Nat) : AndOrXor_2231__A__B__B__C__A___A__B__C_src w ⊑ AndOrXor_2231__A__B__B__C__A___A__B__C_tgt w := by + unfold AndOrXor_2231__A__B__B__C__A___A__B__C_src AndOrXor_2231__A__B__B__C__A___A__B__C_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2231__A__B__B__C__A___A__B__C + + +-- Name:AndOrXor:2243 ((B | C) & A) | B -> B | (A & C) +-- precondition: true +/- + %o = or %B, %C + %op0 = and %o, %A + %r = or %op0, %B + +=> + %a = and %A, %C + %o = or %B, %C + %op0 = and %o, %A + %r = or %B, %a + +-/ +def AndOrXor_2243__B__C__A__B___B__A__C_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _, %C : _, %B : _): + %v1 = "llvm.or" (%B,%C) : (_, _) -> (_) + %v2 = "llvm.and" (%v1,%A) : (_, _) -> (_) + %v3 = "llvm.or" (%v2,%B) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] + +def AndOrXor_2243__B__C__A__B___B__A__C_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _, %C : _, %B : _): + %v1 = "llvm.and" (%A,%C) : (_, _) -> (_) + %v2 = "llvm.or" (%B,%C) : (_, _) -> (_) + %v3 = "llvm.and" (%v2,%A) : (_, _) -> (_) + %v4 = "llvm.or" (%B,%v1) : (_, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] +theorem alive_AndOrXor_2243__B__C__A__B___B__A__C (w : Nat) : AndOrXor_2243__B__C__A__B___B__A__C_src w ⊑ AndOrXor_2243__B__C__A__B___B__A__C_tgt w := by + unfold AndOrXor_2243__B__C__A__B___B__A__C_src AndOrXor_2243__B__C__A__B___B__A__C_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2243__B__C__A__B___B__A__C + + +-- Name:AndOrXor:2247 (~A | ~B) == (~(A & B)) +-- precondition: true +/- + %na = xor %A, -1 + %nb = xor %B, -1 + %r = or %na, %nb + +=> + %a = and %A, %B + %na = xor %A, -1 + %nb = xor %B, -1 + %r = xor %a, -1 + +-/ +def AndOrXor_2247__A__B__A__B_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%A,%v1) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v4 = "llvm.xor" (%B,%v3) : (_, _) -> (_) + %v5 = "llvm.or" (%v2,%v4) : (_, _) -> (_) + "llvm.return" (%v5) : (_) -> () +}] + +def AndOrXor_2247__A__B__A__B_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.and" (%A,%B) : (_, _) -> (_) + %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v3 = "llvm.xor" (%A,%v2) : (_, _) -> (_) + %v4 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v5 = "llvm.xor" (%B,%v4) : (_, _) -> (_) + %v6 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v7 = "llvm.xor" (%v1,%v6) : (_, _) -> (_) + "llvm.return" (%v7) : (_) -> () +}] +theorem alive_AndOrXor_2247__A__B__A__B (w : Nat) : AndOrXor_2247__A__B__A__B_src w ⊑ AndOrXor_2247__A__B__A__B_tgt w := by + unfold AndOrXor_2247__A__B__A__B_src AndOrXor_2247__A__B__A__B_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2247__A__B__A__B + + +-- Name:AndOrXor:2263 +-- precondition: true +/- + %op1 = xor %op0, %B + %r = or %op0, %op1 + +=> + %op1 = xor %op0, %B + %r = or %op0, %B + +-/ +def AndOrXor_2263_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%B : _, %op0 : _): + %v1 = "llvm.xor" (%op0,%B) : (_, _) -> (_) + %v2 = "llvm.or" (%op0,%v1) : (_, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] + +def AndOrXor_2263_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%B : _, %op0 : _): + %v1 = "llvm.xor" (%op0,%B) : (_, _) -> (_) + %v2 = "llvm.or" (%op0,%B) : (_, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] +theorem alive_AndOrXor_2263 (w : Nat) : AndOrXor_2263_src w ⊑ AndOrXor_2263_tgt w := by + unfold AndOrXor_2263_src AndOrXor_2263_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2263 + + +-- Name:AndOrXor:2264 +-- precondition: true +/- + %na = xor %A, -1 + %op1 = xor %na, %B + %r = or %A, %op1 + +=> + %nb = xor %B, -1 + %na = xor %A, -1 + %op1 = xor %na, %B + %r = or %A, %nb + +-/ +def AndOrXor_2264_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%A,%v1) : (_, _) -> (_) + %v3 = "llvm.xor" (%v2,%B) : (_, _) -> (_) + %v4 = "llvm.or" (%A,%v3) : (_, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] + +def AndOrXor_2264_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%B,%v1) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v4 = "llvm.xor" (%A,%v3) : (_, _) -> (_) + %v5 = "llvm.xor" (%v4,%B) : (_, _) -> (_) + %v6 = "llvm.or" (%A,%v2) : (_, _) -> (_) + "llvm.return" (%v6) : (_) -> () +}] +theorem alive_AndOrXor_2264 (w : Nat) : AndOrXor_2264_src w ⊑ AndOrXor_2264_tgt w := by + unfold AndOrXor_2264_src AndOrXor_2264_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2264 + + +-- Name:AndOrXor:2265 +-- precondition: true +/- + %op0 = and %A, %B + %op1 = xor %A, %B + %r = or %op0, %op1 + +=> + %op0 = and %A, %B + %op1 = xor %A, %B + %r = or %A, %B + +-/ +def AndOrXor_2265_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.and" (%A,%B) : (_, _) -> (_) + %v2 = "llvm.xor" (%A,%B) : (_, _) -> (_) + %v3 = "llvm.or" (%v1,%v2) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] + +def AndOrXor_2265_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.and" (%A,%B) : (_, _) -> (_) + %v2 = "llvm.xor" (%A,%B) : (_, _) -> (_) + %v3 = "llvm.or" (%A,%B) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] +theorem alive_AndOrXor_2265 (w : Nat) : AndOrXor_2265_src w ⊑ AndOrXor_2265_tgt w := by + unfold AndOrXor_2265_src AndOrXor_2265_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2265 + + +-- Name:AndOrXor:2284 +-- precondition: true +/- + %o = or %A, %B + %op1 = xor %o, -1 + %r = or %A, %op1 + +=> + %not = xor %B, -1 + %o = or %A, %B + %op1 = xor %o, -1 + %r = or %A, %not + +-/ +def AndOrXor_2284_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.or" (%A,%B) : (_, _) -> (_) + %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v3 = "llvm.xor" (%v1,%v2) : (_, _) -> (_) + %v4 = "llvm.or" (%A,%v3) : (_, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] + +def AndOrXor_2284_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%B,%v1) : (_, _) -> (_) + %v3 = "llvm.or" (%A,%B) : (_, _) -> (_) + %v4 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v5 = "llvm.xor" (%v3,%v4) : (_, _) -> (_) + %v6 = "llvm.or" (%A,%v2) : (_, _) -> (_) + "llvm.return" (%v6) : (_) -> () +}] +theorem alive_AndOrXor_2284 (w : Nat) : AndOrXor_2284_src w ⊑ AndOrXor_2284_tgt w := by + unfold AndOrXor_2284_src AndOrXor_2284_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2284 + + +-- Name:AndOrXor:2285 +-- precondition: true +/- + %o = xor %A, %B + %op1 = xor %o, -1 + %r = or %A, %op1 + +=> + %not = xor %B, -1 + %o = xor %A, %B + %op1 = xor %o, -1 + %r = or %A, %not + +-/ +def AndOrXor_2285_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.xor" (%A,%B) : (_, _) -> (_) + %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v3 = "llvm.xor" (%v1,%v2) : (_, _) -> (_) + %v4 = "llvm.or" (%A,%v3) : (_, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] + +def AndOrXor_2285_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%B,%v1) : (_, _) -> (_) + %v3 = "llvm.xor" (%A,%B) : (_, _) -> (_) + %v4 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v5 = "llvm.xor" (%v3,%v4) : (_, _) -> (_) + %v6 = "llvm.or" (%A,%v2) : (_, _) -> (_) + "llvm.return" (%v6) : (_) -> () +}] +theorem alive_AndOrXor_2285 (w : Nat) : AndOrXor_2285_src w ⊑ AndOrXor_2285_tgt w := by + unfold AndOrXor_2285_src AndOrXor_2285_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2285 + + +-- Name:AndOrXor:2297 +-- precondition: true +/- + %op0 = and %A, %B + %na = xor %A, -1 + %op1 = xor %na, %B + %r = or %op0, %op1 + +=> + %na = xor %A, -1 + %op0 = and %A, %B + %op1 = xor %na, %B + %r = xor %na, %B + +-/ +def AndOrXor_2297_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.and" (%A,%B) : (_, _) -> (_) + %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v3 = "llvm.xor" (%A,%v2) : (_, _) -> (_) + %v4 = "llvm.xor" (%v3,%B) : (_, _) -> (_) + %v5 = "llvm.or" (%v1,%v4) : (_, _) -> (_) + "llvm.return" (%v5) : (_) -> () +}] + +def AndOrXor_2297_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%A,%v1) : (_, _) -> (_) + %v3 = "llvm.and" (%A,%B) : (_, _) -> (_) + %v4 = "llvm.xor" (%v2,%B) : (_, _) -> (_) + %v5 = "llvm.xor" (%v2,%B) : (_, _) -> (_) + "llvm.return" (%v5) : (_) -> () +}] +theorem alive_AndOrXor_2297 (w : Nat) : AndOrXor_2297_src w ⊑ AndOrXor_2297_tgt w := by + unfold AndOrXor_2297_src AndOrXor_2297_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2297 + + +-- Name:AndOrXor:2367 +-- precondition: true +/- + %op0 = or %A, C1 + %r = or %op0, %op1 + +=> + %i = or %A, %op1 + %op0 = or %A, C1 + %r = or %i, C1 + +-/ +def AndOrXor_2367_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _, %C1 : _, %op1 : _): + %v1 = "llvm.or" (%A,%C1) : (_, _) -> (_) + %v2 = "llvm.or" (%v1,%op1) : (_, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] + +def AndOrXor_2367_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _, %C1 : _, %op1 : _): + %v1 = "llvm.or" (%A,%op1) : (_, _) -> (_) + %v2 = "llvm.or" (%A,%C1) : (_, _) -> (_) + %v3 = "llvm.or" (%v1,%C1) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] +theorem alive_AndOrXor_2367 (w : Nat) : AndOrXor_2367_src w ⊑ AndOrXor_2367_tgt w := by + unfold AndOrXor_2367_src AndOrXor_2367_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2367 + + +-- Name:AndOrXor:2416 +-- precondition: true +/- + %x = xor %nx, -1 + %op0 = and %x, %y + %r = xor %op0, -1 + +=> + %ny = xor %y, -1 + %x = xor %nx, -1 + %op0 = and %x, %y + %r = or %nx, %ny + +-/ +def AndOrXor_2416_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%nx : _, %y : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%nx,%v1) : (_, _) -> (_) + %v3 = "llvm.and" (%v2,%y) : (_, _) -> (_) + %v4 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v5 = "llvm.xor" (%v3,%v4) : (_, _) -> (_) + "llvm.return" (%v5) : (_) -> () +}] + +def AndOrXor_2416_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%nx : _, %y : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%y,%v1) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v4 = "llvm.xor" (%nx,%v3) : (_, _) -> (_) + %v5 = "llvm.and" (%v4,%y) : (_, _) -> (_) + %v6 = "llvm.or" (%nx,%v2) : (_, _) -> (_) + "llvm.return" (%v6) : (_) -> () +}] +theorem alive_AndOrXor_2416 (w : Nat) : AndOrXor_2416_src w ⊑ AndOrXor_2416_tgt w := by + unfold AndOrXor_2416_src AndOrXor_2416_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2416 + + +-- Name:AndOrXor:2417 +-- precondition: true +/- + %x = xor %nx, -1 + %op0 = or %x, %y + %r = xor %op0, -1 + +=> + %ny = xor %y, -1 + %x = xor %nx, -1 + %op0 = or %x, %y + %r = and %nx, %ny + +-/ +def AndOrXor_2417_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%nx : _, %y : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%nx,%v1) : (_, _) -> (_) + %v3 = "llvm.or" (%v2,%y) : (_, _) -> (_) + %v4 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v5 = "llvm.xor" (%v3,%v4) : (_, _) -> (_) + "llvm.return" (%v5) : (_) -> () +}] + +def AndOrXor_2417_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%nx : _, %y : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%y,%v1) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v4 = "llvm.xor" (%nx,%v3) : (_, _) -> (_) + %v5 = "llvm.or" (%v4,%y) : (_, _) -> (_) + %v6 = "llvm.and" (%nx,%v2) : (_, _) -> (_) + "llvm.return" (%v6) : (_) -> () +}] +theorem alive_AndOrXor_2417 (w : Nat) : AndOrXor_2417_src w ⊑ AndOrXor_2417_tgt w := by + unfold AndOrXor_2417_src AndOrXor_2417_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2417 + + +-- Name:AndOrXor:2429 +-- precondition: true +/- + %op0 = and %x, %y + %r = xor %op0, -1 + +=> + %nx = xor %x, -1 + %ny = xor %y, -1 + %op0 = and %x, %y + %r = or %nx, %ny + +-/ +def AndOrXor_2429_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%y : _, %x : _): + %v1 = "llvm.and" (%x,%y) : (_, _) -> (_) + %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v3 = "llvm.xor" (%v1,%v2) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] + +def AndOrXor_2429_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%y : _, %x : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%x,%v1) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v4 = "llvm.xor" (%y,%v3) : (_, _) -> (_) + %v5 = "llvm.and" (%x,%y) : (_, _) -> (_) + %v6 = "llvm.or" (%v2,%v4) : (_, _) -> (_) + "llvm.return" (%v6) : (_) -> () +}] +theorem alive_AndOrXor_2429 (w : Nat) : AndOrXor_2429_src w ⊑ AndOrXor_2429_tgt w := by + unfold AndOrXor_2429_src AndOrXor_2429_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2429 + + +-- Name:AndOrXor:2430 +-- precondition: true +/- + %op0 = or %x, %y + %r = xor %op0, -1 + +=> + %nx = xor %x, -1 + %ny = xor %y, -1 + %op0 = or %x, %y + %r = and %nx, %ny + +-/ +def AndOrXor_2430_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%y : _, %x : _): + %v1 = "llvm.or" (%x,%y) : (_, _) -> (_) + %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v3 = "llvm.xor" (%v1,%v2) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] + +def AndOrXor_2430_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%y : _, %x : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%x,%v1) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v4 = "llvm.xor" (%y,%v3) : (_, _) -> (_) + %v5 = "llvm.or" (%x,%y) : (_, _) -> (_) + %v6 = "llvm.and" (%v2,%v4) : (_, _) -> (_) + "llvm.return" (%v6) : (_) -> () +}] +theorem alive_AndOrXor_2430 (w : Nat) : AndOrXor_2430_src w ⊑ AndOrXor_2430_tgt w := by + unfold AndOrXor_2430_src AndOrXor_2430_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2430 + + +-- Name:AndOrXor:2443 +-- precondition: true +/- + %nx = xor %x, -1 + %op0 = ashr %nx, %y + %r = xor %op0, -1 + +=> + %nx = xor %x, -1 + %op0 = ashr %nx, %y + %r = ashr %x, %y + +-/ +def AndOrXor_2443_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%y : _, %x : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%x,%v1) : (_, _) -> (_) + %v3 = "llvm.ashr" (%v2,%y) : (_, _) -> (_) + %v4 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v5 = "llvm.xor" (%v3,%v4) : (_, _) -> (_) + "llvm.return" (%v5) : (_) -> () +}] + +def AndOrXor_2443_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%y : _, %x : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%x,%v1) : (_, _) -> (_) + %v3 = "llvm.ashr" (%v2,%y) : (_, _) -> (_) + %v4 = "llvm.ashr" (%x,%y) : (_, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] +theorem alive_AndOrXor_2443 (w : Nat) : AndOrXor_2443_src w ⊑ AndOrXor_2443_tgt w := by + unfold AndOrXor_2443_src AndOrXor_2443_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2443 + + +-- Name:AndOrXor:2453 +-- precondition: true +/- + %op0 = icmp slt %x, %y + %r = xor %op0, -1 + +=> + %op0 = icmp slt %x, %y + %r = icmp sge %x, %y + +-/ +def AndOrXor_2453_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%y : _, %x : _): + %v1 = "llvm.icmp slt " (%x,%y) : (_, _) -> (_) + %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v3 = "llvm.xor" (%v1,%v2) : (_, _) -> (i1) + "llvm.return" (%v3) : (i1) -> () +}] + +def AndOrXor_2453_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%y : _, %x : _): + %v1 = "llvm.icmp slt " (%x,%y) : (_, _) -> (_) + %v2 = "llvm.icmp sge " (%x,%y) : (_, _) -> (_) + "llvm.return" (%v2) : (i1) -> () +}] +theorem alive_AndOrXor_2453 : AndOrXor_2453_src ⊑ AndOrXor_2453_tgt := by + unfold AndOrXor_2453_src AndOrXor_2453_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2453 + + +-- Name:AndOrXor:2475 +-- precondition: true +/- + %op0 = sub C, %x + %r = xor %op0, -1 + +=> + %op0 = sub C, %x + %r = add %x, (-1 - C) + +-/ +def AndOrXor_2475_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%x : _, %C : _): + %v1 = "llvm.sub" (%C,%x) : (_, _) -> (_) + %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v3 = "llvm.xor" (%v1,%v2) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] + +def AndOrXor_2475_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%x : _, %C : _): + %v1 = "llvm.sub" (%C,%x) : (_, _) -> (_) + %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v3 = "llvm.sub" (%v2,%C) : (_, _) -> (_) + %v4 = "llvm.add" (%x,%v3) : (_, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] +theorem alive_AndOrXor_2475 (w : Nat) : AndOrXor_2475_src w ⊑ AndOrXor_2475_tgt w := by + unfold AndOrXor_2475_src AndOrXor_2475_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2475 + + +-- Name:AndOrXor:2486 +-- precondition: true +/- + %op0 = add %x, C + %r = xor %op0, -1 + +=> + %op0 = add %x, C + %r = sub (-1 - C), %x + +-/ +def AndOrXor_2486_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%x : _, %C : _): + %v1 = "llvm.add" (%x,%C) : (_, _) -> (_) + %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v3 = "llvm.xor" (%v1,%v2) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] + +def AndOrXor_2486_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%x : _, %C : _): + %v1 = "llvm.add" (%x,%C) : (_, _) -> (_) + %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v3 = "llvm.sub" (%v2,%C) : (_, _) -> (_) + %v4 = "llvm.sub" (%v3,%x) : (_, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] +theorem alive_AndOrXor_2486 (w : Nat) : AndOrXor_2486_src w ⊑ AndOrXor_2486_tgt w := by + unfold AndOrXor_2486_src AndOrXor_2486_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2486 + + +-- Name:AndOrXor:2581 (B|A)^B -> A & ~B +-- precondition: true +/- + %op0 = or %a, %op1 + %r = xor %op0, %op1 + +=> + %nop1 = xor %op1, -1 + %op0 = or %a, %op1 + %r = and %a, %nop1 + +-/ +def AndOrXor_2581__BAB___A__B_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%a : _, %op1 : _): + %v1 = "llvm.or" (%a,%op1) : (_, _) -> (_) + %v2 = "llvm.xor" (%v1,%op1) : (_, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] + +def AndOrXor_2581__BAB___A__B_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%a : _, %op1 : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%op1,%v1) : (_, _) -> (_) + %v3 = "llvm.or" (%a,%op1) : (_, _) -> (_) + %v4 = "llvm.and" (%a,%v2) : (_, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] +theorem alive_AndOrXor_2581__BAB___A__B (w : Nat) : AndOrXor_2581__BAB___A__B_src w ⊑ AndOrXor_2581__BAB___A__B_tgt w := by + unfold AndOrXor_2581__BAB___A__B_src AndOrXor_2581__BAB___A__B_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2581__BAB___A__B + + +-- Name:AndOrXor:2587 (B&A)^A -> ~B & A +-- precondition: true +/- + %op0 = and %a, %op1 + %r = xor %op0, %op1 + +=> + %na = xor %a, -1 + %op0 = and %a, %op1 + %r = and %na, %op1 + +-/ +def AndOrXor_2587__BAA___B__A_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%a : _, %op1 : _): + %v1 = "llvm.and" (%a,%op1) : (_, _) -> (_) + %v2 = "llvm.xor" (%v1,%op1) : (_, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] + +def AndOrXor_2587__BAA___B__A_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%a : _, %op1 : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) + %v3 = "llvm.and" (%a,%op1) : (_, _) -> (_) + %v4 = "llvm.and" (%v2,%op1) : (_, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] +theorem alive_AndOrXor_2587__BAA___B__A (w : Nat) : AndOrXor_2587__BAA___B__A_src w ⊑ AndOrXor_2587__BAA___B__A_tgt w := by + unfold AndOrXor_2587__BAA___B__A_src AndOrXor_2587__BAA___B__A_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2587__BAA___B__A + + +-- Name:AndOrXor:2595 +-- precondition: true +/- + %op0 = and %a, %b + %op1 = or %a, %b + %r = xor %op0, %op1 + +=> + %op0 = and %a, %b + %op1 = or %a, %b + %r = xor %a, %b + +-/ +def AndOrXor_2595_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) + %v2 = "llvm.or" (%a,%b) : (_, _) -> (_) + %v3 = "llvm.xor" (%v1,%v2) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] + +def AndOrXor_2595_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) + %v2 = "llvm.or" (%a,%b) : (_, _) -> (_) + %v3 = "llvm.xor" (%a,%b) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] +theorem alive_AndOrXor_2595 (w : Nat) : AndOrXor_2595_src w ⊑ AndOrXor_2595_tgt w := by + unfold AndOrXor_2595_src AndOrXor_2595_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2595 + + +-- Name:AndOrXor:2607 +-- precondition: true +/- + %na = xor %a, -1 + %nb = xor %b, -1 + %op0 = or %a, %nb + %op1 = or %na, %b + %r = xor %op0, %op1 + +=> + %na = xor %a, -1 + %nb = xor %b, -1 + %op0 = or %a, %nb + %op1 = or %na, %b + %r = xor %a, %b + +-/ +def AndOrXor_2607_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v4 = "llvm.xor" (%b,%v3) : (_, _) -> (_) + %v5 = "llvm.or" (%a,%v4) : (_, _) -> (_) + %v6 = "llvm.or" (%v2,%b) : (_, _) -> (_) + %v7 = "llvm.xor" (%v5,%v6) : (_, _) -> (_) + "llvm.return" (%v7) : (_) -> () +}] + +def AndOrXor_2607_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v4 = "llvm.xor" (%b,%v3) : (_, _) -> (_) + %v5 = "llvm.or" (%a,%v4) : (_, _) -> (_) + %v6 = "llvm.or" (%v2,%b) : (_, _) -> (_) + %v7 = "llvm.xor" (%a,%b) : (_, _) -> (_) + "llvm.return" (%v7) : (_) -> () +}] +theorem alive_AndOrXor_2607 (w : Nat) : AndOrXor_2607_src w ⊑ AndOrXor_2607_tgt w := by + unfold AndOrXor_2607_src AndOrXor_2607_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2607 + + +-- Name:AndOrXor:2617 +-- precondition: true +/- + %na = xor %a, -1 + %nb = xor %b, -1 + %op0 = and %a, %nb + %op1 = and %na, %b + %r = xor %op0, %op1 + +=> + %na = xor %a, -1 + %nb = xor %b, -1 + %op0 = and %a, %nb + %op1 = and %na, %b + %r = xor %a, %b + +-/ +def AndOrXor_2617_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v4 = "llvm.xor" (%b,%v3) : (_, _) -> (_) + %v5 = "llvm.and" (%a,%v4) : (_, _) -> (_) + %v6 = "llvm.and" (%v2,%b) : (_, _) -> (_) + %v7 = "llvm.xor" (%v5,%v6) : (_, _) -> (_) + "llvm.return" (%v7) : (_) -> () +}] + +def AndOrXor_2617_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v4 = "llvm.xor" (%b,%v3) : (_, _) -> (_) + %v5 = "llvm.and" (%a,%v4) : (_, _) -> (_) + %v6 = "llvm.and" (%v2,%b) : (_, _) -> (_) + %v7 = "llvm.xor" (%a,%b) : (_, _) -> (_) + "llvm.return" (%v7) : (_) -> () +}] +theorem alive_AndOrXor_2617 (w : Nat) : AndOrXor_2617_src w ⊑ AndOrXor_2617_tgt w := by + unfold AndOrXor_2617_src AndOrXor_2617_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2617 + + +-- Name:AndOrXor:2627 +-- precondition: true +/- + %op0 = xor %a, %c + %op1 = or %a, %b + %r = xor %op0, %op1 + +=> + %na = xor %a, -1 + %and = and %na, %b + %op0 = xor %a, %c + %op1 = or %a, %b + %r = xor %and, %c + +-/ +def AndOrXor_2627_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%a : _, %c : _, %b : _): + %v1 = "llvm.xor" (%a,%c) : (_, _) -> (_) + %v2 = "llvm.or" (%a,%b) : (_, _) -> (_) + %v3 = "llvm.xor" (%v1,%v2) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] + +def AndOrXor_2627_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%a : _, %c : _, %b : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) + %v3 = "llvm.and" (%v2,%b) : (_, _) -> (_) + %v4 = "llvm.xor" (%a,%c) : (_, _) -> (_) + %v5 = "llvm.or" (%a,%b) : (_, _) -> (_) + %v6 = "llvm.xor" (%v3,%c) : (_, _) -> (_) + "llvm.return" (%v6) : (_) -> () +}] +theorem alive_AndOrXor_2627 (w : Nat) : AndOrXor_2627_src w ⊑ AndOrXor_2627_tgt w := by + unfold AndOrXor_2627_src AndOrXor_2627_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2627 + + +-- Name:AndOrXor:2647 +-- precondition: true +/- + %op0 = and %a, %b + %op1 = xor %a, %b + %r = xor %op0, %op1 + +=> + %op0 = and %a, %b + %op1 = xor %a, %b + %r = or %a, %b + +-/ +def AndOrXor_2647_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) + %v2 = "llvm.xor" (%a,%b) : (_, _) -> (_) + %v3 = "llvm.xor" (%v1,%v2) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] + +def AndOrXor_2647_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) + %v2 = "llvm.xor" (%a,%b) : (_, _) -> (_) + %v3 = "llvm.or" (%a,%b) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] +theorem alive_AndOrXor_2647 (w : Nat) : AndOrXor_2647_src w ⊑ AndOrXor_2647_tgt w := by + unfold AndOrXor_2647_src AndOrXor_2647_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2647 + + +-- Name:AndOrXor:2658 +-- precondition: true +/- + %nb = xor %b, -1 + %op0 = and %a, %nb + %na = xor %a, -1 + %r = xor %op0, %na + +=> + %and = and %a, %b + %nb = xor %b, -1 + %op0 = and %a, %nb + %na = xor %a, -1 + %r = xor %and, -1 + +-/ +def AndOrXor_2658_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%b,%v1) : (_, _) -> (_) + %v3 = "llvm.and" (%a,%v2) : (_, _) -> (_) + %v4 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v5 = "llvm.xor" (%a,%v4) : (_, _) -> (_) + %v6 = "llvm.xor" (%v3,%v5) : (_, _) -> (_) + "llvm.return" (%v6) : (_) -> () +}] + +def AndOrXor_2658_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) + %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v3 = "llvm.xor" (%b,%v2) : (_, _) -> (_) + %v4 = "llvm.and" (%a,%v3) : (_, _) -> (_) + %v5 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v6 = "llvm.xor" (%a,%v5) : (_, _) -> (_) + %v7 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v8 = "llvm.xor" (%v1,%v7) : (_, _) -> (_) + "llvm.return" (%v8) : (_) -> () +}] +theorem alive_AndOrXor_2658 (w : Nat) : AndOrXor_2658_src w ⊑ AndOrXor_2658_tgt w := by + unfold AndOrXor_2658_src AndOrXor_2658_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2658 + + +-- Name:AndOrXor:2663 +-- precondition: true +/- + %op0 = icmp ule %a, %b + %op1 = icmp ne %a, %b + %r = xor %op0, %op1 + +=> + %op0 = icmp ule %a, %b + %op1 = icmp ne %a, %b + %r = icmp uge %a, %b + +-/ +def AndOrXor_2663_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.icmp ule " (%a,%b) : (_, _) -> (_) + %v2 = "llvm.icmp ne " (%a,%b) : (_, _) -> (_) + %v3 = "llvm.xor" (%v1,%v2) : (_, _) -> (i1) + "llvm.return" (%v3) : (i1) -> () +}] + +def AndOrXor_2663_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.icmp ule " (%a,%b) : (_, _) -> (_) + %v2 = "llvm.icmp ne " (%a,%b) : (_, _) -> (_) + %v3 = "llvm.icmp uge " (%a,%b) : (_, _) -> (_) + "llvm.return" (%v3) : (i1) -> () +}] +theorem alive_AndOrXor_2663 : AndOrXor_2663_src ⊑ AndOrXor_2663_tgt := by + unfold AndOrXor_2663_src AndOrXor_2663_tgt + simp_alive_peephole + apply bitvec_AndOrXor_2663 + + +-- Name:152 +-- precondition: true +/- + %r = mul %x, -1 + +=> + %r = sub 0, %x + +-/ +def 152_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%x : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.mul" (%x,%v1) : (_, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] + +def 152_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%x : _): + %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v2 = "llvm.sub" (%v1,%x) : (_, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] +theorem alive_152 (w : Nat) : 152_src w ⊑ 152_tgt w := by + unfold 152_src 152_tgt + simp_alive_peephole + apply bitvec_152 + + +-- Name:229 +-- precondition: true +/- + %Op0 = add %X, C1 + %r = mul %Op0, %Op1 + +=> + %mul = mul C1, %Op1 + %tmp = mul %X, %Op1 + %Op0 = add %X, C1 + %r = add %tmp, %mul + +-/ +def 229_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%X : _, %C1 : _, %Op1 : _): + %v1 = "llvm.add" (%X,%C1) : (_, _) -> (_) + %v2 = "llvm.mul" (%v1,%Op1) : (_, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] + +def 229_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%X : _, %C1 : _, %Op1 : _): + %v1 = "llvm.mul" (%C1,%Op1) : (_, _) -> (_) + %v2 = "llvm.mul" (%X,%Op1) : (_, _) -> (_) + %v3 = "llvm.add" (%X,%C1) : (_, _) -> (_) + %v4 = "llvm.add" (%v2,%v1) : (_, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] +theorem alive_229 (w : Nat) : 229_src w ⊑ 229_tgt w := by + unfold 229_src 229_tgt + simp_alive_peephole + apply bitvec_229 + + +-- Name:239 +-- precondition: true +/- + %a = sub 0, %X + %b = sub 0, %Y + %r = mul %a, %b + +=> + %a = sub 0, %X + %b = sub 0, %Y + %r = mul %X, %Y + +-/ +def 239_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%Y : _, %X : _): + %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v2 = "llvm.sub" (%v1,%X) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v4 = "llvm.sub" (%v3,%Y) : (_, _) -> (_) + %v5 = "llvm.mul" (%v2,%v4) : (_, _) -> (_) + "llvm.return" (%v5) : (_) -> () +}] + +def 239_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%Y : _, %X : _): + %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v2 = "llvm.sub" (%v1,%X) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v4 = "llvm.sub" (%v3,%Y) : (_, _) -> (_) + %v5 = "llvm.mul" (%X,%Y) : (_, _) -> (_) + "llvm.return" (%v5) : (_) -> () +}] +theorem alive_239 (w : Nat) : 239_src w ⊑ 239_tgt w := by + unfold 239_src 239_tgt + simp_alive_peephole + apply bitvec_239 + + +-- Name:275 +-- precondition: true +/- + %div = udiv i5 %X, %Y + %r = mul %div, %Y + +=> + %rem = urem %X, %Y + %div = udiv i5 %X, %Y + %r = sub %X, %rem + +-/ +def 275_src := +[mlir_icom ()| { +^bb0(%Y : i5, %X : i5): + %v1 = "llvm.udiv" (%X,%Y) : (i5, i5) -> (i5) + %v2 = "llvm.mul" (%v1,%Y) : (i5, i5) -> (i5) + "llvm.return" (%v2) : (i5) -> () +}] + +def 275_tgt := +[mlir_icom ()| { +^bb0(%Y : i5, %X : i5): + %v1 = "llvm.urem" (%X,%Y) : (i5, i5) -> (i5) + %v2 = "llvm.udiv" (%X,%Y) : (i5, i5) -> (i5) + %v3 = "llvm.sub" (%X,%v1) : (i5, i5) -> (i5) + "llvm.return" (%v3) : (i5) -> () +}] +theorem alive_275 : 275_src ⊑ 275_tgt := by + unfold 275_src 275_tgt + simp_alive_peephole + apply bitvec_275 + + +-- Name:275-2 +-- precondition: true +/- + %div = sdiv i5 %X, %Y + %r = mul %div, %Y + +=> + %rem = srem %X, %Y + %div = sdiv i5 %X, %Y + %r = sub %X, %rem + +-/ +def 275_2_src := +[mlir_icom ()| { +^bb0(%Y : i5, %X : i5): + %v1 = "llvm.sdiv" (%X,%Y) : (i5, i5) -> (i5) + %v2 = "llvm.mul" (%v1,%Y) : (i5, i5) -> (i5) + "llvm.return" (%v2) : (i5) -> () +}] + +def 275_2_tgt := +[mlir_icom ()| { +^bb0(%Y : i5, %X : i5): + %v1 = "llvm.srem" (%X,%Y) : (i5, i5) -> (i5) + %v2 = "llvm.sdiv" (%X,%Y) : (i5, i5) -> (i5) + %v3 = "llvm.sub" (%X,%v1) : (i5, i5) -> (i5) + "llvm.return" (%v3) : (i5) -> () +}] +theorem alive_275_2 : 275_2_src ⊑ 275_2_tgt := by + unfold 275_2_src 275_2_tgt + simp_alive_peephole + apply bitvec_275_2 + + +-- Name:276 +-- precondition: true +/- + %div = sdiv i5 %X, %Y + %negY = sub 0, %Y + %r = mul %div, %negY + +=> + %rem = srem %X, %Y + %div = sdiv i5 %X, %Y + %negY = sub 0, %Y + %r = sub %rem, %X + +-/ +def 276_src := +[mlir_icom ()| { +^bb0(%Y : i5, %X : i5): + %v1 = "llvm.sdiv" (%X,%Y) : (i5, i5) -> (i5) + %v2 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v3 = "llvm.sub" (%v2,%Y) : (_, i5) -> (i5) + %v4 = "llvm.mul" (%v1,%v3) : (i5, i5) -> (i5) + "llvm.return" (%v4) : (i5) -> () +}] + +def 276_tgt := +[mlir_icom ()| { +^bb0(%Y : i5, %X : i5): + %v1 = "llvm.srem" (%X,%Y) : (i5, i5) -> (i5) + %v2 = "llvm.sdiv" (%X,%Y) : (i5, i5) -> (i5) + %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v4 = "llvm.sub" (%v3,%Y) : (_, i5) -> (i5) + %v5 = "llvm.sub" (%v1,%X) : (i5, i5) -> (i5) + "llvm.return" (%v5) : (i5) -> () +}] +theorem alive_276 : 276_src ⊑ 276_tgt := by + unfold 276_src 276_tgt + simp_alive_peephole + apply bitvec_276 + + +-- Name:276-2 +-- precondition: true +/- + %div = udiv i5 %X, %Y + %negY = sub 0, %Y + %r = mul %div, %negY + +=> + %rem = urem %X, %Y + %div = udiv i5 %X, %Y + %negY = sub 0, %Y + %r = sub %rem, %X + +-/ +def 276_2_src := +[mlir_icom ()| { +^bb0(%Y : i5, %X : i5): + %v1 = "llvm.udiv" (%X,%Y) : (i5, i5) -> (i5) + %v2 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v3 = "llvm.sub" (%v2,%Y) : (_, i5) -> (i5) + %v4 = "llvm.mul" (%v1,%v3) : (i5, i5) -> (i5) + "llvm.return" (%v4) : (i5) -> () +}] + +def 276_2_tgt := +[mlir_icom ()| { +^bb0(%Y : i5, %X : i5): + %v1 = "llvm.urem" (%X,%Y) : (i5, i5) -> (i5) + %v2 = "llvm.udiv" (%X,%Y) : (i5, i5) -> (i5) + %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v4 = "llvm.sub" (%v3,%Y) : (_, i5) -> (i5) + %v5 = "llvm.sub" (%v1,%X) : (i5, i5) -> (i5) + "llvm.return" (%v5) : (i5) -> () +}] +theorem alive_276_2 : 276_2_src ⊑ 276_2_tgt := by + unfold 276_2_src 276_2_tgt + simp_alive_peephole + apply bitvec_276_2 + + +-- Name:283 +-- precondition: true +/- + %r = mul i1 %X, %Y + +=> + %r = and %X, %Y + +-/ +def 283_src := +[mlir_icom ()| { +^bb0(%Y : i1, %X : i1): + %v1 = "llvm.mul" (%X,%Y) : (i1, i1) -> (i1) + "llvm.return" (%v1) : (i1) -> () +}] + +def 283_tgt := +[mlir_icom ()| { +^bb0(%Y : i1, %X : i1): + %v1 = "llvm.and" (%X,%Y) : (i1, i1) -> (i1) + "llvm.return" (%v1) : (i1) -> () +}] +theorem alive_283 : 283_src ⊑ 283_tgt := by + unfold 283_src 283_tgt + simp_alive_peephole + apply bitvec_283 + + +-- Name:290 & 292 +-- precondition: true +/- + %Op0 = shl 1, %Y + %r = mul %Op0, %Op1 + +=> + %Op0 = shl 1, %Y + %r = shl %Op1, %Y + +-/ +def 290__292_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%Y : _, %Op1 : _): + %v1 = "llvm.mlir.constant" () { value = 1 : _ } :() -> (_) + %v2 = "llvm.shl" (%v1,%Y) : (_, _) -> (_) + %v3 = "llvm.mul" (%v2,%Op1) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] + +def 290__292_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%Y : _, %Op1 : _): + %v1 = "llvm.mlir.constant" () { value = 1 : _ } :() -> (_) + %v2 = "llvm.shl" (%v1,%Y) : (_, _) -> (_) + %v3 = "llvm.shl" (%Op1,%Y) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] +theorem alive_290__292 (w : Nat) : 290__292_src w ⊑ 290__292_tgt w := by + unfold 290__292_src 290__292_tgt + simp_alive_peephole + apply bitvec_290__292 + + +-- Name:805 +-- precondition: true +/- + %r = sdiv 1, %X + +=> + %inc = add %X, 1 + %c = icmp ult %inc, 3 + %r = select i1 %c, %X, 0 + +-/ +def 805_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%X : _): + %v1 = "llvm.mlir.constant" () { value = 1 : _ } :() -> (_) + %v2 = "llvm.sdiv" (%v1,%X) : (_, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] + +def 805_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%X : _): + %v1 = "llvm.mlir.constant" () { value = 1 : _ } :() -> (_) + %v2 = "llvm.add" (%X,%v1) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = 3 : _ } :() -> (_) + %v4 = "llvm.icmp ult " (%v2,%v3) : (_, _) -> (_) + %v5 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v6 = "llvm.select" (%v4,%X,%v5) : (_, _, _) -> (_) + "llvm.return" (%v6) : (_) -> () +}] +theorem alive_805 (w : Nat) : 805_src w ⊑ 805_tgt w := by + unfold 805_src 805_tgt + simp_alive_peephole + apply bitvec_805 + + +-- Name:820 +-- precondition: true +/- + %Z = srem i9 %X, %Op1 + %Op0 = sub %X, %Z + %r = sdiv %Op0, %Op1 + +=> + %Z = srem i9 %X, %Op1 + %Op0 = sub %X, %Z + %r = sdiv %X, %Op1 + +-/ +def 820_src := +[mlir_icom ()| { +^bb0(%X : i9, %Op1 : i9): + %v1 = "llvm.srem" (%X,%Op1) : (i9, i9) -> (i9) + %v2 = "llvm.sub" (%X,%v1) : (i9, i9) -> (i9) + %v3 = "llvm.sdiv" (%v2,%Op1) : (i9, i9) -> (i9) + "llvm.return" (%v3) : (i9) -> () +}] + +def 820_tgt := +[mlir_icom ()| { +^bb0(%X : i9, %Op1 : i9): + %v1 = "llvm.srem" (%X,%Op1) : (i9, i9) -> (i9) + %v2 = "llvm.sub" (%X,%v1) : (i9, i9) -> (i9) + %v3 = "llvm.sdiv" (%X,%Op1) : (i9, i9) -> (i9) + "llvm.return" (%v3) : (i9) -> () +}] +theorem alive_820 : 820_src ⊑ 820_tgt := by + unfold 820_src 820_tgt + simp_alive_peephole + apply bitvec_820 + + +-- Name:820' +-- precondition: true +/- + %Z = urem i9 %X, %Op1 + %Op0 = sub %X, %Z + %r = udiv %Op0, %Op1 + +=> + %Z = urem i9 %X, %Op1 + %Op0 = sub %X, %Z + %r = udiv %X, %Op1 + +-/ +def 820'_src := +[mlir_icom ()| { +^bb0(%X : i9, %Op1 : i9): + %v1 = "llvm.urem" (%X,%Op1) : (i9, i9) -> (i9) + %v2 = "llvm.sub" (%X,%v1) : (i9, i9) -> (i9) + %v3 = "llvm.udiv" (%v2,%Op1) : (i9, i9) -> (i9) + "llvm.return" (%v3) : (i9) -> () +}] + +def 820'_tgt := +[mlir_icom ()| { +^bb0(%X : i9, %Op1 : i9): + %v1 = "llvm.urem" (%X,%Op1) : (i9, i9) -> (i9) + %v2 = "llvm.sub" (%X,%v1) : (i9, i9) -> (i9) + %v3 = "llvm.udiv" (%X,%Op1) : (i9, i9) -> (i9) + "llvm.return" (%v3) : (i9) -> () +}] +theorem alive_820' : 820'_src ⊑ 820'_tgt := by + unfold 820'_src 820'_tgt + simp_alive_peephole + apply bitvec_820' + + +-- Name:1030 +-- precondition: true +/- + %r = sdiv %X, -1 + +=> + %r = sub 0, %X + +-/ +def 1030_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%X : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.sdiv" (%X,%v1) : (_, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] + +def 1030_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%X : _): + %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v2 = "llvm.sub" (%v1,%X) : (_, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] +theorem alive_1030 (w : Nat) : 1030_src w ⊑ 1030_tgt w := by + unfold 1030_src 1030_tgt + simp_alive_peephole + apply bitvec_1030 + + +-- Name:Select:637 +-- precondition: true +/- + %c = icmp eq %X, C + %r = select i1 %c, %X, %Y + +=> + %c = icmp eq %X, C + %r = select i1 %c, C, %Y + +-/ +def Select_637_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%Y : _, %X : _, %C : _): + %v1 = "llvm.icmp eq " (%X,%C) : (_, _) -> (_) + %v2 = "llvm.select" (%v1,%X,%Y) : (_, _, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] + +def Select_637_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%Y : _, %X : _, %C : _): + %v1 = "llvm.icmp eq " (%X,%C) : (_, _) -> (_) + %v2 = "llvm.select" (%v1,%C,%Y) : (_, _, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] +theorem alive_Select_637 (w : Nat) : Select_637_src w ⊑ Select_637_tgt w := by + unfold Select_637_src Select_637_tgt + simp_alive_peephole + apply bitvec_Select_637 + + +-- Name:Select:641 +-- precondition: true +/- + %c = icmp ne %X, C + %r = select i1 %c, %Y, %X + +=> + %c = icmp ne %X, C + %r = select i1 %c, %Y, C + +-/ +def Select_641_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%Y : _, %X : _, %C : _): + %v1 = "llvm.icmp ne " (%X,%C) : (_, _) -> (_) + %v2 = "llvm.select" (%v1,%Y,%X) : (_, _, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] + +def Select_641_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%Y : _, %X : _, %C : _): + %v1 = "llvm.icmp ne " (%X,%C) : (_, _) -> (_) + %v2 = "llvm.select" (%v1,%Y,%C) : (_, _, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] +theorem alive_Select_641 (w : Nat) : Select_641_src w ⊑ Select_641_tgt w := by + unfold Select_641_src Select_641_tgt + simp_alive_peephole + apply bitvec_Select_641 + + +-- Name:Select:699 +-- precondition: true +/- + %c = icmp uge %A, %B + %umax = select i1 %c, %A, %B + %c2 = icmp uge %umax, %B + %umax2 = select i1 %c2, %umax, %B + +=> + %c = icmp uge %A, %B + %umax = select i1 %c, %A, %B + %c2 = icmp uge %umax, %B + %umax2 = select i1 %c, %A, %B + +-/ +def Select_699_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.icmp uge " (%A,%B) : (_, _) -> (_) + %v2 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) + %v3 = "llvm.icmp uge " (%v2,%B) : (_, _) -> (_) + %v4 = "llvm.select" (%v3,%v2,%B) : (_, _, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] + +def Select_699_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.icmp uge " (%A,%B) : (_, _) -> (_) + %v2 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) + %v3 = "llvm.icmp uge " (%v2,%B) : (_, _) -> (_) + %v4 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] +theorem alive_Select_699 (w : Nat) : Select_699_src w ⊑ Select_699_tgt w := by + unfold Select_699_src Select_699_tgt + simp_alive_peephole + apply bitvec_Select_699 + + +-- Name:Select:700 +-- precondition: true +/- + %c = icmp slt %A, %B + %smin = select i1 %c, %A, %B + %c2 = icmp slt %smin, %B + %smin2 = select i1 %c2, %smin, %B + +=> + %c = icmp slt %A, %B + %smin = select i1 %c, %A, %B + %c2 = icmp slt %smin, %B + %smin2 = select i1 %c, %A, %B + +-/ +def Select_700_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.icmp slt " (%A,%B) : (_, _) -> (_) + %v2 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) + %v3 = "llvm.icmp slt " (%v2,%B) : (_, _) -> (_) + %v4 = "llvm.select" (%v3,%v2,%B) : (_, _, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] + +def Select_700_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.icmp slt " (%A,%B) : (_, _) -> (_) + %v2 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) + %v3 = "llvm.icmp slt " (%v2,%B) : (_, _) -> (_) + %v4 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] +theorem alive_Select_700 (w : Nat) : Select_700_src w ⊑ Select_700_tgt w := by + unfold Select_700_src Select_700_tgt + simp_alive_peephole + apply bitvec_Select_700 + + +-- Name:Select:704 +-- precondition: true +/- + %c = icmp slt %A, %B + %smin = select i1 %c, %A, %B + %c2 = icmp sge %smin, %A + %smax = select i1 %c2, %smin, %A + +=> + %c = icmp slt %A, %B + %smin = select i1 %c, %A, %B + %c2 = icmp sge %smin, %A + %smax = %A + +-/ +def Select_704_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.icmp slt " (%A,%B) : (_, _) -> (_) + %v2 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) + %v3 = "llvm.icmp sge " (%v2,%A) : (_, _) -> (_) + %v4 = "llvm.select" (%v3,%v2,%A) : (_, _, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] + +def Select_704_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.icmp slt " (%A,%B) : (_, _) -> (_) + %v2 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) + %v3 = "llvm.icmp sge " (%v2,%A) : (_, _) -> (_) + %v4 = "llvm.copy" (%A) : (_) -> (_) + "llvm.return" (%v4) : (_) -> () +}] +theorem alive_Select_704 (w : Nat) : Select_704_src w ⊑ Select_704_tgt w := by + unfold Select_704_src Select_704_tgt + simp_alive_peephole + apply bitvec_Select_704 + + +-- Name:Select:705 +-- precondition: true +/- + %c = icmp sge %A, %B + %umax = select i1 %c, %A, %B + %c2 = icmp slt %umax, %A + %umin = select i1 %c2, %umax, %A + +=> + %c = icmp sge %A, %B + %umax = select i1 %c, %A, %B + %c2 = icmp slt %umax, %A + %umin = %A + +-/ +def Select_705_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.icmp sge " (%A,%B) : (_, _) -> (_) + %v2 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) + %v3 = "llvm.icmp slt " (%v2,%A) : (_, _) -> (_) + %v4 = "llvm.select" (%v3,%v2,%A) : (_, _, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] + +def Select_705_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _, %B : _): + %v1 = "llvm.icmp sge " (%A,%B) : (_, _) -> (_) + %v2 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) + %v3 = "llvm.icmp slt " (%v2,%A) : (_, _) -> (_) + %v4 = "llvm.copy" (%A) : (_) -> (_) + "llvm.return" (%v4) : (_) -> () +}] +theorem alive_Select_705 (w : Nat) : Select_705_src w ⊑ Select_705_tgt w := by + unfold Select_705_src Select_705_tgt + simp_alive_peephole + apply bitvec_Select_705 + + +-- Name:Select:740 +-- precondition: true +/- + %c = icmp sgt %A, 0 + %minus = sub 0, %A + %abs = select i1 %c, %A, %minus + %c2 = icmp sgt %abs, -1 + %minus2 = sub 0, %abs + %abs2 = select i1 %c2, %abs, %minus2 + +=> + %c = icmp sgt %A, 0 + %minus = sub 0, %A + %abs = select i1 %c, %A, %minus + %c2 = icmp sgt %abs, -1 + %minus2 = sub 0, %abs + %abs2 = select i1 %c, %A, %minus + +-/ +def Select_740_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _): + %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v2 = "llvm.icmp sgt " (%A,%v1) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v4 = "llvm.sub" (%v3,%A) : (_, _) -> (_) + %v5 = "llvm.select" (%v2,%A,%v4) : (_, _, _) -> (_) + %v6 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v7 = "llvm.icmp sgt " (%v5,%v6) : (_, _) -> (_) + %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v9 = "llvm.sub" (%v8,%v5) : (_, _) -> (_) + %v10 = "llvm.select" (%v7,%v5,%v9) : (_, _, _) -> (_) + "llvm.return" (%v10) : (_) -> () +}] + +def Select_740_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _): + %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v2 = "llvm.icmp sgt " (%A,%v1) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v4 = "llvm.sub" (%v3,%A) : (_, _) -> (_) + %v5 = "llvm.select" (%v2,%A,%v4) : (_, _, _) -> (_) + %v6 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v7 = "llvm.icmp sgt " (%v5,%v6) : (_, _) -> (_) + %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v9 = "llvm.sub" (%v8,%v5) : (_, _) -> (_) + %v10 = "llvm.select" (%v2,%A,%v4) : (_, _, _) -> (_) + "llvm.return" (%v10) : (_) -> () +}] +theorem alive_Select_740 (w : Nat) : Select_740_src w ⊑ Select_740_tgt w := by + unfold Select_740_src Select_740_tgt + simp_alive_peephole + apply bitvec_Select_740 + + +-- Name:Select:741 +-- precondition: true +/- + %c = icmp sgt %A, 0 + %minus = sub 0, %A + %abs = select i1 %c, %minus, %A + %c2 = icmp sgt %abs, -1 + %minus2 = sub 0, %abs + %abs2 = select i1 %c2, %minus2, %abs + +=> + %c = icmp sgt %A, 0 + %minus = sub 0, %A + %abs = select i1 %c, %minus, %A + %c2 = icmp sgt %abs, -1 + %minus2 = sub 0, %abs + %abs2 = select i1 %c, %minus, %A + +-/ +def Select_741_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _): + %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v2 = "llvm.icmp sgt " (%A,%v1) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v4 = "llvm.sub" (%v3,%A) : (_, _) -> (i1) + %v5 = "llvm.select" (%v2,%v4,%A) : (_, _, _) -> (_) + %v6 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v7 = "llvm.icmp sgt " (%v5,%v6) : (_, _) -> (_) + %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v9 = "llvm.sub" (%v8,%v5) : (_, _) -> (_) + %v10 = "llvm.select" (%v7,%v9,%v5) : (_, _, _) -> (_) + "llvm.return" (%v10) : (_) -> () +}] + +def Select_741_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _): + %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v2 = "llvm.icmp sgt " (%A,%v1) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v4 = "llvm.sub" (%v3,%A) : (_, _) -> (i1) + %v5 = "llvm.select" (%v2,%v4,%A) : (_, _, _) -> (_) + %v6 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v7 = "llvm.icmp sgt " (%v5,%v6) : (_, _) -> (_) + %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v9 = "llvm.sub" (%v8,%v5) : (_, _) -> (_) + %v10 = "llvm.select" (%v2,%v4,%A) : (_, _, _) -> (i1) + "llvm.return" (%v10) : (i1) -> () +}] +theorem alive_Select_741 : Select_741_src ⊑ Select_741_tgt := by + unfold Select_741_src Select_741_tgt + simp_alive_peephole + apply bitvec_Select_741 + + +-- Name:Select:746 +-- precondition: true +/- + %c = icmp slt %A, 0 + %minus = sub 0, %A + %abs = select i1 %c, %A, %minus + %c2 = icmp sgt %abs, 0 + %minus2 = sub 0, %abs + %abs2 = select i1 %c2, %abs, %minus2 + +=> + %minus = sub 0, %A + %c3 = icmp sgt %A, 0 + %c = icmp slt %A, 0 + %abs = select i1 %c, %A, %minus + %c2 = icmp sgt %abs, 0 + %minus2 = sub 0, %abs + %abs2 = select i1 %c3, %A, %minus + +-/ +def Select_746_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _): + %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v2 = "llvm.icmp slt " (%A,%v1) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v4 = "llvm.sub" (%v3,%A) : (_, _) -> (_) + %v5 = "llvm.select" (%v2,%A,%v4) : (_, _, _) -> (_) + %v6 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v7 = "llvm.icmp sgt " (%v5,%v6) : (_, _) -> (_) + %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v9 = "llvm.sub" (%v8,%v5) : (_, _) -> (_) + %v10 = "llvm.select" (%v7,%v5,%v9) : (_, _, _) -> (_) + "llvm.return" (%v10) : (_) -> () +}] + +def Select_746_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _): + %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v2 = "llvm.sub" (%v1,%A) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v4 = "llvm.icmp sgt " (%A,%v3) : (_, _) -> (_) + %v5 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v6 = "llvm.icmp slt " (%A,%v5) : (_, _) -> (_) + %v7 = "llvm.select" (%v6,%A,%v2) : (_, _, _) -> (_) + %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v9 = "llvm.icmp sgt " (%v7,%v8) : (_, _) -> (_) + %v10 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v11 = "llvm.sub" (%v10,%v7) : (_, _) -> (_) + %v12 = "llvm.select" (%v4,%A,%v2) : (_, _, _) -> (_) + "llvm.return" (%v12) : (_) -> () +}] +theorem alive_Select_746 (w : Nat) : Select_746_src w ⊑ Select_746_tgt w := by + unfold Select_746_src Select_746_tgt + simp_alive_peephole + apply bitvec_Select_746 + + +-- Name:Select:747 +-- precondition: true +/- + %c = icmp sgt %A, 0 + %minus = sub 0, %A + %abs = select i1 %c, %A, %minus + %c2 = icmp slt %abs, 0 + %minus2 = sub 0, %abs + %abs2 = select i1 %c2, %abs, %minus2 + +=> + %minus = sub 0, %A + %c3 = icmp slt %A, 0 + %c = icmp sgt %A, 0 + %abs = select i1 %c, %A, %minus + %c2 = icmp slt %abs, 0 + %minus2 = sub 0, %abs + %abs2 = select i1 %c3, %A, %minus + +-/ +def Select_747_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%A : _): + %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v2 = "llvm.icmp sgt " (%A,%v1) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v4 = "llvm.sub" (%v3,%A) : (_, _) -> (_) + %v5 = "llvm.select" (%v2,%A,%v4) : (_, _, _) -> (_) + %v6 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v7 = "llvm.icmp slt " (%v5,%v6) : (_, _) -> (_) + %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v9 = "llvm.sub" (%v8,%v5) : (_, _) -> (_) + %v10 = "llvm.select" (%v7,%v5,%v9) : (_, _, _) -> (_) + "llvm.return" (%v10) : (_) -> () +}] + +def Select_747_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%A : _): + %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v2 = "llvm.sub" (%v1,%A) : (_, _) -> (_) + %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v4 = "llvm.icmp slt " (%A,%v3) : (_, _) -> (_) + %v5 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v6 = "llvm.icmp sgt " (%A,%v5) : (_, _) -> (_) + %v7 = "llvm.select" (%v6,%A,%v2) : (_, _, _) -> (_) + %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v9 = "llvm.icmp slt " (%v7,%v8) : (_, _) -> (_) + %v10 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) + %v11 = "llvm.sub" (%v10,%v7) : (_, _) -> (_) + %v12 = "llvm.select" (%v4,%A,%v2) : (_, _, _) -> (_) + "llvm.return" (%v12) : (_) -> () +}] +theorem alive_Select_747 (w : Nat) : Select_747_src w ⊑ Select_747_tgt w := by + unfold Select_747_src Select_747_tgt + simp_alive_peephole + apply bitvec_Select_747 + + +-- Name:Select:858 +-- precondition: true +/- + %nota = xor %a, -1 + %r = select i1 %a, %nota, %b + +=> + %nota = xor %a, -1 + %r = and %nota, %b + +-/ +def Select_858_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) + %v3 = "llvm.select" (%a,%v2,%b) : (_, _, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] + +def Select_858_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) + %v3 = "llvm.and" (%v2,%b) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] +theorem alive_Select_858 (w : Nat) : Select_858_src w ⊑ Select_858_tgt w := by + unfold Select_858_src Select_858_tgt + simp_alive_peephole + apply bitvec_Select_858 + + +-- Name:Select:859' +-- precondition: true +/- + %nota = xor %a, -1 + %r = select i1 %a, %b, %nota + +=> + %nota = xor %a, -1 + %r = or %nota, %b + +-/ +def Select_859'_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) + %v3 = "llvm.select" (%a,%b,%v2) : (_, _, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] + +def Select_859'_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%a : _, %b : _): + %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) + %v3 = "llvm.or" (%v2,%b) : (_, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] +theorem alive_Select_859' (w : Nat) : Select_859'_src w ⊑ Select_859'_tgt w := by + unfold Select_859'_src Select_859'_tgt + simp_alive_peephole + apply bitvec_Select_859' + + +-- Name:Select:1087 +-- precondition: true +/- + %c = xor i1 %val, true + %r = select i1 %c, %X, %Y + +=> + %c = xor i1 %val, true + %r = select i1 %val, %Y, %X + +-/ +def Select_1087_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%Y : _, %X : _, %val : _): + %v1 = "llvm.mlir.constant" () { value = 1 : 1 } :() -> (i1) + %v2 = "llvm.xor" (%val,%v1) : (_, i1) -> (i1) + %v3 = "llvm.select" (%v2,%X,%Y) : (i1, _, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] + +def Select_1087_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%Y : _, %X : _, %val : _): + %v1 = "llvm.mlir.constant" () { value = 1 : 1 } :() -> (i1) + %v2 = "llvm.xor" (%val,%v1) : (_, i1) -> (i1) + %v3 = "llvm.select" (%val,%Y,%X) : (_, _, _) -> (_) + "llvm.return" (%v3) : (_) -> () +}] +theorem alive_Select_1087 (w : Nat) : Select_1087_src w ⊑ Select_1087_tgt w := by + unfold Select_1087_src Select_1087_tgt + simp_alive_peephole + apply bitvec_Select_1087 + + +-- Name:Select:1100 +-- precondition: true +/- + %r = select i1 true, %X, %Y + +=> + %r = %X + +-/ +def Select_1100_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%Y : _, %X : _): + %v1 = "llvm.mlir.constant" () { value = 1 : 1 } :() -> (i1) + %v2 = "llvm.select" (%v1,%X,%Y) : (i1, _, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] + +def Select_1100_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%Y : _, %X : _): + %v1 = "llvm.copy" (%X) : (_) -> (_) + "llvm.return" (%v1) : (_) -> () +}] +theorem alive_Select_1100 (w : Nat) : Select_1100_src w ⊑ Select_1100_tgt w := by + unfold Select_1100_src Select_1100_tgt + simp_alive_peephole + apply bitvec_Select_1100 + + +-- Name:Select:1105 +-- precondition: true +/- + %r = select i1 false, %X, %Y + +=> + %r = %Y + +-/ +def Select_1105_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%Y : _, %X : _): + %v1 = "llvm.mlir.constant" () { value = 0 : 1 } :() -> (i1) + %v2 = "llvm.select" (%v1,%X,%Y) : (i1, _, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] + +def Select_1105_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%Y : _, %X : _): + %v1 = "llvm.copy" (%Y) : (_) -> (_) + "llvm.return" (%v1) : (_) -> () +}] +theorem alive_Select_1105 (w : Nat) : Select_1105_src w ⊑ Select_1105_tgt w := by + unfold Select_1105_src Select_1105_tgt + simp_alive_peephole + apply bitvec_Select_1105 + + +-- Name:InstCombineShift: 239 +-- precondition: true +/- + %Op0 = shl %X, C + %r = lshr %Op0, C + +=> + %Op0 = shl %X, C + %r = and %X, (-1 u>> C) + +-/ +def InstCombineShift__239_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%X : _, %C : _): + %v1 = "llvm.shl" (%X,%C) : (_, _) -> (_) + %v2 = "llvm.lshr" (%v1,%C) : (_, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] + +def InstCombineShift__239_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%X : _, %C : _): + %v1 = "llvm.shl" (%X,%C) : (_, _) -> (_) + %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v3 = "llvm.lshr" (%v2,%C) : (_, _) -> (_) + %v4 = "llvm.and" (%X,%v3) : (_, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] +theorem alive_InstCombineShift__239 (w : Nat) : InstCombineShift__239_src w ⊑ InstCombineShift__239_tgt w := by + unfold InstCombineShift__239_src InstCombineShift__239_tgt + simp_alive_peephole + apply bitvec_InstCombineShift__239 + + +-- Name:InstCombineShift: 279 +-- precondition: true +/- + %Op0 = lshr %X, C + %r = shl %Op0, C + +=> + %Op0 = lshr %X, C + %r = and %X, (-1 << C) + +-/ +def InstCombineShift__279_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%X : _, %C : _): + %v1 = "llvm.lshr" (%X,%C) : (_, _) -> (_) + %v2 = "llvm.shl" (%v1,%C) : (_, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] + +def InstCombineShift__279_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%X : _, %C : _): + %v1 = "llvm.lshr" (%X,%C) : (_, _) -> (_) + %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v3 = "llvm.shl" (%v2,%C) : (_, _) -> (_) + %v4 = "llvm.and" (%X,%v3) : (_, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] +theorem alive_InstCombineShift__279 (w : Nat) : InstCombineShift__279_src w ⊑ InstCombineShift__279_tgt w := by + unfold InstCombineShift__279_src InstCombineShift__279_tgt + simp_alive_peephole + apply bitvec_InstCombineShift__279 + + +-- Name:InstCombineShift: 440 +-- precondition: true +/- + %s = lshr %X, C + %Op1 = and %s, C2 + %Op0 = xor %Y, %Op1 + %r = shl %Op0, C + +=> + %a = and %X, (C2 << C) + %y2 = shl %Y, C + %s = lshr %X, C + %Op1 = and %s, C2 + %Op0 = xor %Y, %Op1 + %r = xor %a, %y2 + +-/ +def InstCombineShift__440_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%Y : _, %X : _, %C : _, %C2 : _): + %v1 = "llvm.lshr" (%X,%C) : (_, _) -> (_) + %v2 = "llvm.and" (%v1,%C2) : (_, _) -> (_) + %v3 = "llvm.xor" (%Y,%v2) : (_, _) -> (_) + %v4 = "llvm.shl" (%v3,%C) : (_, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] + +def InstCombineShift__440_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%Y : _, %X : _, %C : _, %C2 : _): + %v1 = "llvm.shl" (%C2,%C) : (_, _) -> (_) + %v2 = "llvm.and" (%X,%v1) : (_, _) -> (_) + %v3 = "llvm.shl" (%Y,%C) : (_, _) -> (_) + %v4 = "llvm.lshr" (%X,%C) : (_, _) -> (_) + %v5 = "llvm.and" (%v4,%C2) : (_, _) -> (_) + %v6 = "llvm.xor" (%Y,%v5) : (_, _) -> (_) + %v7 = "llvm.xor" (%v2,%v3) : (_, _) -> (_) + "llvm.return" (%v7) : (_) -> () +}] +theorem alive_InstCombineShift__440 (w : Nat) : InstCombineShift__440_src w ⊑ InstCombineShift__440_tgt w := by + unfold InstCombineShift__440_src InstCombineShift__440_tgt + simp_alive_peephole + apply bitvec_InstCombineShift__440 + + +-- Name:InstCombineShift: 476 +-- precondition: true +/- + %shr = lshr %X, C + %s = and %shr, C2 + %Op0 = or %s, %Y + %r = shl %Op0, C + +=> + %s2 = shl %Y, C + %a = and %X, (C2 << C) + %shr = lshr %X, C + %s = and %shr, C2 + %Op0 = or %s, %Y + %r = or %a, %s2 + +-/ +def InstCombineShift__476_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%Y : _, %X : _, %C : _, %C2 : _): + %v1 = "llvm.lshr" (%X,%C) : (_, _) -> (_) + %v2 = "llvm.and" (%v1,%C2) : (_, _) -> (_) + %v3 = "llvm.or" (%v2,%Y) : (_, _) -> (_) + %v4 = "llvm.shl" (%v3,%C) : (_, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] + +def InstCombineShift__476_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%Y : _, %X : _, %C : _, %C2 : _): + %v1 = "llvm.shl" (%Y,%C) : (_, _) -> (_) + %v2 = "llvm.shl" (%C2,%C) : (_, _) -> (_) + %v3 = "llvm.and" (%X,%v2) : (_, _) -> (_) + %v4 = "llvm.lshr" (%X,%C) : (_, _) -> (_) + %v5 = "llvm.and" (%v4,%C2) : (_, _) -> (_) + %v6 = "llvm.or" (%v5,%Y) : (_, _) -> (_) + %v7 = "llvm.or" (%v3,%v1) : (_, _) -> (_) + "llvm.return" (%v7) : (_) -> () +}] +theorem alive_InstCombineShift__476 (w : Nat) : InstCombineShift__476_src w ⊑ InstCombineShift__476_tgt w := by + unfold InstCombineShift__476_src InstCombineShift__476_tgt + simp_alive_peephole + apply bitvec_InstCombineShift__476 + + +-- Name:InstCombineShift: 497 +-- precondition: true +/- + %Op0 = xor %X, C2 + %r = lshr %Op0, C + +=> + %s2 = lshr %X, C + %Op0 = xor %X, C2 + %r = xor %s2, (C2 u>> C) + +-/ +def InstCombineShift__497_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%X : _, %C : _, %C2 : _): + %v1 = "llvm.xor" (%X,%C2) : (_, _) -> (_) + %v2 = "llvm.lshr" (%v1,%C) : (_, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] + +def InstCombineShift__497_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%X : _, %C : _, %C2 : _): + %v1 = "llvm.lshr" (%X,%C) : (_, _) -> (_) + %v2 = "llvm.xor" (%X,%C2) : (_, _) -> (_) + %v3 = "llvm.lshr" (%C2,%C) : (_, _) -> (_) + %v4 = "llvm.xor" (%v1,%v3) : (_, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] +theorem alive_InstCombineShift__497 (w : Nat) : InstCombineShift__497_src w ⊑ InstCombineShift__497_tgt w := by + unfold InstCombineShift__497_src InstCombineShift__497_tgt + simp_alive_peephole + apply bitvec_InstCombineShift__497 + + +-- Name:InstCombineShift: 497''' +-- precondition: true +/- + %Op0 = add %X, C2 + %r = shl %Op0, C + +=> + %s2 = shl %X, C + %Op0 = add %X, C2 + %r = add %s2, (C2 << C) + +-/ +def InstCombineShift__497'''_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%X : _, %C : _, %C2 : _): + %v1 = "llvm.add" (%X,%C2) : (_, _) -> (_) + %v2 = "llvm.shl" (%v1,%C) : (_, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] + +def InstCombineShift__497'''_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%X : _, %C : _, %C2 : _): + %v1 = "llvm.shl" (%X,%C) : (_, _) -> (_) + %v2 = "llvm.add" (%X,%C2) : (_, _) -> (_) + %v3 = "llvm.shl" (%C2,%C) : (_, _) -> (_) + %v4 = "llvm.add" (%v1,%v3) : (_, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] +theorem alive_InstCombineShift__497''' (w : Nat) : InstCombineShift__497'''_src w ⊑ InstCombineShift__497'''_tgt w := by + unfold InstCombineShift__497'''_src InstCombineShift__497'''_tgt + simp_alive_peephole + apply bitvec_InstCombineShift__497''' + + +-- Name:InstCombineShift: 582 +-- precondition: true +/- + %Op0 = shl %X, C + %r = lshr %Op0, C + +=> + %Op0 = shl %X, C + %r = and %X, (-1 u>> C) + +-/ +def InstCombineShift__582_src (w : Nat) := +[mlir_icom (w)| { +^bb0(%X : _, %C : _): + %v1 = "llvm.shl" (%X,%C) : (_, _) -> (_) + %v2 = "llvm.lshr" (%v1,%C) : (_, _) -> (_) + "llvm.return" (%v2) : (_) -> () +}] + +def InstCombineShift__582_tgt (w : Nat):= +[mlir_icom (w)| { +^bb0(%X : _, %C : _): + %v1 = "llvm.shl" (%X,%C) : (_, _) -> (_) + %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) + %v3 = "llvm.lshr" (%v2,%C) : (_, _) -> (_) + %v4 = "llvm.and" (%X,%v3) : (_, _) -> (_) + "llvm.return" (%v4) : (_) -> () +}] +theorem alive_InstCombineShift__582 (w : Nat) : InstCombineShift__582_src w ⊑ InstCombineShift__582_tgt w := by + unfold InstCombineShift__582_src InstCombineShift__582_tgt + simp_alive_peephole + apply bitvec_InstCombineShift__582 diff --git a/SSA/Projects/InstCombine/LLVM/Transform.lean b/SSA/Projects/InstCombine/LLVM/Transform.lean index c6ae0d966..0ec0866d6 100644 --- a/SSA/Projects/InstCombine/LLVM/Transform.lean +++ b/SSA/Projects/InstCombine/LLVM/Transform.lean @@ -29,7 +29,7 @@ inductive TransformError | widthError {φ} (expected got : Width φ) | unsupportedUnaryOp | unsupportedBinaryOp - | unsupportedOp + | unsupportedOp (error : String) | unsupportedType | generic (error : String) @@ -48,7 +48,7 @@ instance : Repr TransformError where | widthError expected got => f!"Type mismatch: {expected} ≠ {got}" | unsupportedUnaryOp => f!"Unsuported unary operation" | unsupportedBinaryOp => f!"Unsuported binary operation" - | unsupportedOp => f!"Unsuported operation" + | unsupportedOp err => f!"Unsuported operation '{err}'" | unsupportedType => f!"Unsuported type" | generic err => err @@ -320,7 +320,7 @@ def mkIcmp {Γ : Ctxt _} {ty : MTy φ} (op : MOp φ) .nil ⟩ else throw <| .widthError w w' - | _ => throw .unsupportedOp -- unsupported icmp operation + | _ => throw <| .unsupportedOp "unsupported icmp operation" def mkSelect {Γ : Context φ} {ty : MTy φ} (op : MOp φ) (c : Var Γ (.bitvec 1)) (e₁ e₂ : Var Γ ty) : @@ -336,7 +336,7 @@ def mkSelect {Γ : Context φ} {ty : MTy φ} (op : MOp φ) .nil ⟩ else throw <| .widthError w w' - | _ => throw .unsupportedOp -- "Unsupported select operation" + | _ => throw <| .unsupportedOp "Unsupported select operation" def mkOpExpr {Γ : Context φ} (op : MOp φ) (arg : HVector (fun t => Ctxt.Var Γ t) (OpSignature.sig op)) : @@ -355,7 +355,7 @@ def mkOpExpr {Γ : Context φ} (op : MOp φ) | .select _ => let (c, e₁, e₂) := arg.toTuple mkSelect op c e₁ e₂ - | .const .. => throw .unsupportedOp -- "Tried to build Op expression from constant" + | .const .. => throw <| .unsupportedOp "Tried to build Op expression from constant" def MLIRType.mkTy : MLIRType φ → ExceptM (MTy φ) | MLIRType.int Signedness.Signless w => do @@ -408,7 +408,7 @@ def mkExpr (Γ : Context φ) (opStx : Op φ) : ReaderM (Σ ty, Expr Γ ty) := do | "llvm.sdiv" => pure (MOp.sdiv w₁) | "llvm.udiv" => pure (MOp.udiv w₁) --| "llvm.icmp" => return InstCombine.Op.icmp v₁.width - | _ => throw .unsupportedOp -- "Unsuported operation or invalid arguments" + | opstr => throw <| .unsupportedOp s!"Unsuported operation or invalid arguments '{opstr}'" if hty : w₁ = w₂ then let binOp ← (mkBinOp op v₁ (hty ▸ v₂) : ExceptM _) return ⟨.bitvec w₁, binOp⟩ diff --git a/related-work/alive/alive b/related-work/alive/alive index 1a1b86a52..d4568eccd 160000 --- a/related-work/alive/alive +++ b/related-work/alive/alive @@ -1 +1 @@ -Subproject commit 1a1b86a52628308436ff2df40384bff39098811a +Subproject commit d4568eccde2c06225e3fbb4036f21762380927c1 From 1c50181a65e4b455731b1da48fdf83af7f3b02b3 Mon Sep 17 00:00:00 2001 From: Siddharth Bhat Date: Mon, 30 Oct 2023 20:57:09 +0000 Subject: [PATCH 02/12] add simp lemma for -1 --- SSA/Projects/InstCombine/Tactic.lean | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/SSA/Projects/InstCombine/Tactic.lean b/SSA/Projects/InstCombine/Tactic.lean index 2ac9565b3..48808c371 100644 --- a/SSA/Projects/InstCombine/Tactic.lean +++ b/SSA/Projects/InstCombine/Tactic.lean @@ -1,10 +1,21 @@ import SSA.Projects.InstCombine.LLVM.EDSL import SSA.Projects.InstCombine.AliveStatements import SSA.Projects.InstCombine.Refinement +import Mathlib.Tactic open MLIR AST open Std (BitVec) +theorem bitvec_minus_one : BitVec.ofInt w (Int.negSucc 0) = (-1 : BitVec w) := by + simp[BitVec.ofInt, BitVec.ofNat,Neg.neg, + BitVec.neg, BitVec.sub, BitVec.toFin, Fin.ofNat', HSub.hSub, Sub.sub, Fin.sub] + simp + sorry + + + + + /-- - We first simplify `Com.refinement` to see the context `Γv`. - We `simp_peephole Γv` to simplify context accesses by variables. @@ -26,7 +37,7 @@ macro "simp_alive_peephole" : tactic => bind, Option.bind, pure, DerivedContext.ofContext, DerivedContext.snoc, Ctxt.snoc, MOp.instantiateCom, InstCombine.MTy.instantiate, ConcreteOrMVar.instantiate, Vector.get, HVector.toSingle, - HVector.toTuple, List.nthLe] + HVector.toTuple, List.nthLe, bitvec_minus_one] try intros v0 try intros v1 try intros v2 From 7b8c20952814422499b14f36d8421f2bc674302c Mon Sep 17 00:00:00 2001 From: Siddharth Bhat Date: Mon, 30 Oct 2023 21:39:51 +0000 Subject: [PATCH 03/12] haven't seen this one before: failed to compile pattern match MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` ./././SSA/Projects/InstCombine/LLVM/Transform.lean:411:8: error: failed to compile pattern matching, stuck at remaining variables: [val✝:(String)] alternatives: [] |- ["eq"] => h_1 () examples:(some _) ``` --- .../InstCombine/AliveAutoGenerated.lean | 844 +++++++++--------- SSA/Projects/InstCombine/LLVM/Transform.lean | 7 +- SSA/Projects/MLIRSyntax/AST.lean | 9 +- 3 files changed, 435 insertions(+), 425 deletions(-) diff --git a/SSA/Projects/InstCombine/AliveAutoGenerated.lean b/SSA/Projects/InstCombine/AliveAutoGenerated.lean index 8eea3b28c..1346911d1 100644 --- a/SSA/Projects/InstCombine/AliveAutoGenerated.lean +++ b/SSA/Projects/InstCombine/AliveAutoGenerated.lean @@ -30,7 +30,7 @@ set_option pp.proofs.withType false %r = sub %RHS, %or -/ -def AddSub_1043_src (w : Nat) := +def alive_AddSub_1043_src (w : Nat) := [mlir_icom (w)| { ^bb0(%C1 : _, %Z : _, %RHS : _): %v1 = "llvm.and" (%Z,%C1) : (_, _) -> (_) @@ -41,7 +41,7 @@ def AddSub_1043_src (w : Nat) := "llvm.return" (%v5) : (_) -> () }] -def AddSub_1043_tgt (w : Nat):= +def alive_AddSub_1043_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%C1 : _, %Z : _, %RHS : _): %v1 = "llvm.not" (%C1) : (_) -> (_) @@ -53,8 +53,8 @@ def AddSub_1043_tgt (w : Nat):= %v7 = "llvm.sub" (%RHS,%v2) : (_, _) -> (_) "llvm.return" (%v7) : (_) -> () }] -theorem alive_AddSub_1043 (w : Nat) : AddSub_1043_src w ⊑ AddSub_1043_tgt w := by - unfold AddSub_1043_src AddSub_1043_tgt +theorem alive_AddSub_1043 (w : Nat) : alive_AddSub_1043_src w ⊑ alive_AddSub_1043_tgt w := by + unfold alive_AddSub_1043_src alive_AddSub_1043_tgt simp_alive_peephole apply bitvec_AddSub_1043 @@ -68,21 +68,21 @@ theorem alive_AddSub_1043 (w : Nat) : AddSub_1043_src w ⊑ AddSub_1043_tgt w %r = xor %x, %y -/ -def AddSub_1152_src := +def alive_AddSub_1152_src := [mlir_icom ()| { ^bb0(%y : i1, %x : i1): %v1 = "llvm.add" (%x,%y) : (i1, i1) -> (i1) "llvm.return" (%v1) : (i1) -> () }] -def AddSub_1152_tgt := +def alive_AddSub_1152_tgt := [mlir_icom ()| { ^bb0(%y : i1, %x : i1): %v1 = "llvm.xor" (%x,%y) : (i1, i1) -> (i1) "llvm.return" (%v1) : (i1) -> () }] -theorem alive_AddSub_1152 : AddSub_1152_src ⊑ AddSub_1152_tgt := by - unfold AddSub_1152_src AddSub_1152_tgt +theorem alive_AddSub_1152 : alive_AddSub_1152_src ⊑ alive_AddSub_1152_tgt := by + unfold alive_AddSub_1152_src alive_AddSub_1152_tgt simp_alive_peephole apply bitvec_AddSub_1152 @@ -96,22 +96,22 @@ theorem alive_AddSub_1152 : AddSub_1152_src ⊑ AddSub_1152_tgt := by %a = shl %b, 1 -/ -def AddSub_1156_src (w : Nat) := +def alive_AddSub_1156_src (w : Nat) := [mlir_icom (w)| { ^bb0(%b : _): %v1 = "llvm.add" (%b,%b) : (_, _) -> (_) "llvm.return" (%v1) : (_) -> () }] -def AddSub_1156_tgt (w : Nat):= +def alive_AddSub_1156_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%b : _): %v1 = "llvm.mlir.constant" () { value = 1 : _ } :() -> (_) %v2 = "llvm.shl" (%b,%v1) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -theorem alive_AddSub_1156 (w : Nat) : AddSub_1156_src w ⊑ AddSub_1156_tgt w := by - unfold AddSub_1156_src AddSub_1156_tgt +theorem alive_AddSub_1156 (w : Nat) : alive_AddSub_1156_src w ⊑ alive_AddSub_1156_tgt w := by + unfold alive_AddSub_1156_src alive_AddSub_1156_tgt simp_alive_peephole apply bitvec_AddSub_1156 @@ -127,7 +127,7 @@ theorem alive_AddSub_1156 (w : Nat) : AddSub_1156_src w ⊑ AddSub_1156_tgt w %c = sub %b, %a -/ -def AddSub_1164_src (w : Nat) := +def alive_AddSub_1164_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) @@ -136,7 +136,7 @@ def AddSub_1164_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def AddSub_1164_tgt (w : Nat):= +def alive_AddSub_1164_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) @@ -144,8 +144,8 @@ def AddSub_1164_tgt (w : Nat):= %v3 = "llvm.sub" (%b,%a) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_AddSub_1164 (w : Nat) : AddSub_1164_src w ⊑ AddSub_1164_tgt w := by - unfold AddSub_1164_src AddSub_1164_tgt +theorem alive_AddSub_1164 (w : Nat) : alive_AddSub_1164_src w ⊑ alive_AddSub_1164_tgt w := by + unfold alive_AddSub_1164_src alive_AddSub_1164_tgt simp_alive_peephole apply bitvec_AddSub_1164 @@ -164,7 +164,7 @@ theorem alive_AddSub_1164 (w : Nat) : AddSub_1164_src w ⊑ AddSub_1164_tgt w %c = sub 0, %ab -/ -def AddSub_1165_src (w : Nat) := +def alive_AddSub_1165_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) @@ -175,7 +175,7 @@ def AddSub_1165_src (w : Nat) := "llvm.return" (%v5) : (_) -> () }] -def AddSub_1165_tgt (w : Nat):= +def alive_AddSub_1165_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.add" (%a,%b) : (_, _) -> (_) @@ -187,8 +187,8 @@ def AddSub_1165_tgt (w : Nat):= %v7 = "llvm.sub" (%v6,%v1) : (_, _) -> (_) "llvm.return" (%v7) : (_) -> () }] -theorem alive_AddSub_1165 (w : Nat) : AddSub_1165_src w ⊑ AddSub_1165_tgt w := by - unfold AddSub_1165_src AddSub_1165_tgt +theorem alive_AddSub_1165 (w : Nat) : alive_AddSub_1165_src w ⊑ alive_AddSub_1165_tgt w := by + unfold alive_AddSub_1165_src alive_AddSub_1165_tgt simp_alive_peephole apply bitvec_AddSub_1165 @@ -204,7 +204,7 @@ theorem alive_AddSub_1165 (w : Nat) : AddSub_1165_src w ⊑ AddSub_1165_tgt w %c = sub %a, %b -/ -def AddSub_1176_src (w : Nat) := +def alive_AddSub_1176_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) @@ -213,7 +213,7 @@ def AddSub_1176_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def AddSub_1176_tgt (w : Nat):= +def alive_AddSub_1176_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) @@ -221,8 +221,8 @@ def AddSub_1176_tgt (w : Nat):= %v3 = "llvm.sub" (%a,%b) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_AddSub_1176 (w : Nat) : AddSub_1176_src w ⊑ AddSub_1176_tgt w := by - unfold AddSub_1176_src AddSub_1176_tgt +theorem alive_AddSub_1176 (w : Nat) : alive_AddSub_1176_src w ⊑ alive_AddSub_1176_tgt w := by + unfold alive_AddSub_1176_src alive_AddSub_1176_tgt simp_alive_peephole apply bitvec_AddSub_1176 @@ -238,7 +238,7 @@ theorem alive_AddSub_1176 (w : Nat) : AddSub_1176_src w ⊑ AddSub_1176_tgt w %r = sub (C - 1), %x -/ -def AddSub_1202_src (w : Nat) := +def alive_AddSub_1202_src (w : Nat) := [mlir_icom (w)| { ^bb0(%x : _, %C : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -247,7 +247,7 @@ def AddSub_1202_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def AddSub_1202_tgt (w : Nat):= +def alive_AddSub_1202_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%x : _, %C : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -257,8 +257,8 @@ def AddSub_1202_tgt (w : Nat):= %v5 = "llvm.sub" (%v4,%x) : (_, _) -> (_) "llvm.return" (%v5) : (_) -> () }] -theorem alive_AddSub_1202 (w : Nat) : AddSub_1202_src w ⊑ AddSub_1202_tgt w := by - unfold AddSub_1202_src AddSub_1202_tgt +theorem alive_AddSub_1202 (w : Nat) : alive_AddSub_1202_src w ⊑ alive_AddSub_1202_tgt w := by + unfold alive_AddSub_1202_src alive_AddSub_1202_tgt simp_alive_peephole apply bitvec_AddSub_1202 @@ -276,7 +276,7 @@ theorem alive_AddSub_1202 (w : Nat) : AddSub_1202_src w ⊑ AddSub_1202_tgt w %c = or %a, %b -/ -def AddSub_1295_src (w : Nat) := +def alive_AddSub_1295_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) @@ -285,7 +285,7 @@ def AddSub_1295_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def AddSub_1295_tgt (w : Nat):= +def alive_AddSub_1295_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) @@ -293,8 +293,8 @@ def AddSub_1295_tgt (w : Nat):= %v3 = "llvm.or" (%a,%b) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_AddSub_1295 (w : Nat) : AddSub_1295_src w ⊑ AddSub_1295_tgt w := by - unfold AddSub_1295_src AddSub_1295_tgt +theorem alive_AddSub_1295 (w : Nat) : alive_AddSub_1295_src w ⊑ alive_AddSub_1295_tgt w := by + unfold alive_AddSub_1295_src alive_AddSub_1295_tgt simp_alive_peephole apply bitvec_AddSub_1295 @@ -312,7 +312,7 @@ theorem alive_AddSub_1295 (w : Nat) : AddSub_1295_src w ⊑ AddSub_1295_tgt w %c = add %a, %b -/ -def AddSub_1309_src (w : Nat) := +def alive_AddSub_1309_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) @@ -321,7 +321,7 @@ def AddSub_1309_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def AddSub_1309_tgt (w : Nat):= +def alive_AddSub_1309_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) @@ -329,8 +329,8 @@ def AddSub_1309_tgt (w : Nat):= %v3 = "llvm.add" (%a,%b) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_AddSub_1309 (w : Nat) : AddSub_1309_src w ⊑ AddSub_1309_tgt w := by - unfold AddSub_1309_src AddSub_1309_tgt +theorem alive_AddSub_1309 (w : Nat) : alive_AddSub_1309_src w ⊑ alive_AddSub_1309_tgt w := by + unfold alive_AddSub_1309_src alive_AddSub_1309_tgt simp_alive_peephole apply bitvec_AddSub_1309 @@ -346,7 +346,7 @@ theorem alive_AddSub_1309 (w : Nat) : AddSub_1309_src w ⊑ AddSub_1309_tgt w %r = add %x, %a -/ -def AddSub_1539_src (w : Nat) := +def alive_AddSub_1539_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %x : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) @@ -355,7 +355,7 @@ def AddSub_1539_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def AddSub_1539_tgt (w : Nat):= +def alive_AddSub_1539_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _, %x : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) @@ -363,8 +363,8 @@ def AddSub_1539_tgt (w : Nat):= %v3 = "llvm.add" (%x,%a) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_AddSub_1539 (w : Nat) : AddSub_1539_src w ⊑ AddSub_1539_tgt w := by - unfold AddSub_1539_src AddSub_1539_tgt +theorem alive_AddSub_1539 (w : Nat) : alive_AddSub_1539_src w ⊑ alive_AddSub_1539_tgt w := by + unfold alive_AddSub_1539_src alive_AddSub_1539_tgt simp_alive_peephole apply bitvec_AddSub_1539 @@ -378,22 +378,22 @@ theorem alive_AddSub_1539 (w : Nat) : AddSub_1539_src w ⊑ AddSub_1539_tgt w %r = add %x, -C -/ -def AddSub_1539_2_src (w : Nat) := +def alive_AddSub_1539_2_src (w : Nat) := [mlir_icom (w)| { ^bb0(%x : _, %C : _): %v1 = "llvm.sub" (%x,%C) : (_, _) -> (_) "llvm.return" (%v1) : (_) -> () }] -def AddSub_1539_2_tgt (w : Nat):= +def alive_AddSub_1539_2_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%x : _, %C : _): %v1 = "llvm.neg" (%C) : (_) -> (_) %v2 = "llvm.add" (%x,%v1) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -theorem alive_AddSub_1539_2 (w : Nat) : AddSub_1539_2_src w ⊑ AddSub_1539_2_tgt w := by - unfold AddSub_1539_2_src AddSub_1539_2_tgt +theorem alive_AddSub_1539_2 (w : Nat) : alive_AddSub_1539_2_src w ⊑ alive_AddSub_1539_2_tgt w := by + unfold alive_AddSub_1539_2_src alive_AddSub_1539_2_tgt simp_alive_peephole apply bitvec_AddSub_1539_2 @@ -407,21 +407,21 @@ theorem alive_AddSub_1539_2 (w : Nat) : AddSub_1539_2_src w ⊑ AddSub_1539_2_ %r = xor %x, %y -/ -def AddSub_1556_src := +def alive_AddSub_1556_src := [mlir_icom ()| { ^bb0(%y : i1, %x : i1): %v1 = "llvm.sub" (%x,%y) : (i1, i1) -> (i1) "llvm.return" (%v1) : (i1) -> () }] -def AddSub_1556_tgt := +def alive_AddSub_1556_tgt := [mlir_icom ()| { ^bb0(%y : i1, %x : i1): %v1 = "llvm.xor" (%x,%y) : (i1, i1) -> (i1) "llvm.return" (%v1) : (i1) -> () }] -theorem alive_AddSub_1556 : AddSub_1556_src ⊑ AddSub_1556_tgt := by - unfold AddSub_1556_src AddSub_1556_tgt +theorem alive_AddSub_1556 : alive_AddSub_1556_src ⊑ alive_AddSub_1556_tgt := by + unfold alive_AddSub_1556_src alive_AddSub_1556_tgt simp_alive_peephole apply bitvec_AddSub_1556 @@ -435,7 +435,7 @@ theorem alive_AddSub_1556 : AddSub_1556_src ⊑ AddSub_1556_tgt := by %r = xor %a, -1 -/ -def AddSub_1560_src (w : Nat) := +def alive_AddSub_1560_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -443,15 +443,15 @@ def AddSub_1560_src (w : Nat) := "llvm.return" (%v2) : (_) -> () }] -def AddSub_1560_tgt (w : Nat):= +def alive_AddSub_1560_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -theorem alive_AddSub_1560 (w : Nat) : AddSub_1560_src w ⊑ AddSub_1560_tgt w := by - unfold AddSub_1560_src AddSub_1560_tgt +theorem alive_AddSub_1560 (w : Nat) : alive_AddSub_1560_src w ⊑ alive_AddSub_1560_tgt w := by + unfold alive_AddSub_1560_src alive_AddSub_1560_tgt simp_alive_peephole apply bitvec_AddSub_1560 @@ -467,7 +467,7 @@ theorem alive_AddSub_1560 (w : Nat) : AddSub_1560_src w ⊑ AddSub_1560_tgt w %r = add %x, (C + 1) -/ -def AddSub_1564_src (w : Nat) := +def alive_AddSub_1564_src (w : Nat) := [mlir_icom (w)| { ^bb0(%x : _, %C : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -476,7 +476,7 @@ def AddSub_1564_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def AddSub_1564_tgt (w : Nat):= +def alive_AddSub_1564_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%x : _, %C : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -486,8 +486,8 @@ def AddSub_1564_tgt (w : Nat):= %v5 = "llvm.add" (%x,%v4) : (_, _) -> (_) "llvm.return" (%v5) : (_) -> () }] -theorem alive_AddSub_1564 (w : Nat) : AddSub_1564_src w ⊑ AddSub_1564_tgt w := by - unfold AddSub_1564_src AddSub_1564_tgt +theorem alive_AddSub_1564 (w : Nat) : alive_AddSub_1564_src w ⊑ alive_AddSub_1564_tgt w := by + unfold alive_AddSub_1564_src alive_AddSub_1564_tgt simp_alive_peephole apply bitvec_AddSub_1564 @@ -503,7 +503,7 @@ theorem alive_AddSub_1564 (w : Nat) : AddSub_1564_src w ⊑ AddSub_1564_tgt w %r = sub (C - C2), %X -/ -def AddSub_1574_src (w : Nat) := +def alive_AddSub_1574_src (w : Nat) := [mlir_icom (w)| { ^bb0(%X : _, %C : _, %C2 : _): %v1 = "llvm.add" (%X,%C2) : (_, _) -> (_) @@ -511,7 +511,7 @@ def AddSub_1574_src (w : Nat) := "llvm.return" (%v2) : (_) -> () }] -def AddSub_1574_tgt (w : Nat):= +def alive_AddSub_1574_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%X : _, %C : _, %C2 : _): %v1 = "llvm.add" (%X,%C2) : (_, _) -> (_) @@ -519,8 +519,8 @@ def AddSub_1574_tgt (w : Nat):= %v3 = "llvm.sub" (%v2,%X) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_AddSub_1574 (w : Nat) : AddSub_1574_src w ⊑ AddSub_1574_tgt w := by - unfold AddSub_1574_src AddSub_1574_tgt +theorem alive_AddSub_1574 (w : Nat) : alive_AddSub_1574_src w ⊑ alive_AddSub_1574_tgt w := by + unfold alive_AddSub_1574_src alive_AddSub_1574_tgt simp_alive_peephole apply bitvec_AddSub_1574 @@ -536,7 +536,7 @@ theorem alive_AddSub_1574 (w : Nat) : AddSub_1574_src w ⊑ AddSub_1574_tgt w %r = sub 0, %Y -/ -def AddSub_1614_src (w : Nat) := +def alive_AddSub_1614_src (w : Nat) := [mlir_icom (w)| { ^bb0(%Y : _, %X : _): %v1 = "llvm.add" (%X,%Y) : (_, _) -> (_) @@ -544,7 +544,7 @@ def AddSub_1614_src (w : Nat) := "llvm.return" (%v2) : (_) -> () }] -def AddSub_1614_tgt (w : Nat):= +def alive_AddSub_1614_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%Y : _, %X : _): %v1 = "llvm.add" (%X,%Y) : (_, _) -> (_) @@ -552,8 +552,8 @@ def AddSub_1614_tgt (w : Nat):= %v3 = "llvm.sub" (%v2,%Y) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_AddSub_1614 (w : Nat) : AddSub_1614_src w ⊑ AddSub_1614_tgt w := by - unfold AddSub_1614_src AddSub_1614_tgt +theorem alive_AddSub_1614 (w : Nat) : alive_AddSub_1614_src w ⊑ alive_AddSub_1614_tgt w := by + unfold alive_AddSub_1614_src alive_AddSub_1614_tgt simp_alive_peephole apply bitvec_AddSub_1614 @@ -569,7 +569,7 @@ theorem alive_AddSub_1614 (w : Nat) : AddSub_1614_src w ⊑ AddSub_1614_tgt w %r = sub 0, %Y -/ -def AddSub_1619_src (w : Nat) := +def alive_AddSub_1619_src (w : Nat) := [mlir_icom (w)| { ^bb0(%Y : _, %X : _): %v1 = "llvm.sub" (%X,%Y) : (_, _) -> (_) @@ -577,7 +577,7 @@ def AddSub_1619_src (w : Nat) := "llvm.return" (%v2) : (_) -> () }] -def AddSub_1619_tgt (w : Nat):= +def alive_AddSub_1619_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%Y : _, %X : _): %v1 = "llvm.sub" (%X,%Y) : (_, _) -> (_) @@ -585,8 +585,8 @@ def AddSub_1619_tgt (w : Nat):= %v3 = "llvm.sub" (%v2,%Y) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_AddSub_1619 (w : Nat) : AddSub_1619_src w ⊑ AddSub_1619_tgt w := by - unfold AddSub_1619_src AddSub_1619_tgt +theorem alive_AddSub_1619 (w : Nat) : alive_AddSub_1619_src w ⊑ alive_AddSub_1619_tgt w := by + unfold alive_AddSub_1619_src alive_AddSub_1619_tgt simp_alive_peephole apply bitvec_AddSub_1619 @@ -604,7 +604,7 @@ theorem alive_AddSub_1619 (w : Nat) : AddSub_1619_src w ⊑ AddSub_1619_tgt w %r = and %A, %B -/ -def AddSub_1624_src (w : Nat) := +def alive_AddSub_1624_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.or" (%A,%B) : (_, _) -> (_) @@ -613,7 +613,7 @@ def AddSub_1624_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def AddSub_1624_tgt (w : Nat):= +def alive_AddSub_1624_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.or" (%A,%B) : (_, _) -> (_) @@ -621,8 +621,8 @@ def AddSub_1624_tgt (w : Nat):= %v3 = "llvm.and" (%A,%B) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_AddSub_1624 (w : Nat) : AddSub_1624_src w ⊑ AddSub_1624_tgt w := by - unfold AddSub_1624_src AddSub_1624_tgt +theorem alive_AddSub_1624 (w : Nat) : alive_AddSub_1624_src w ⊑ alive_AddSub_1624_tgt w := by + unfold alive_AddSub_1624_src alive_AddSub_1624_tgt simp_alive_peephole apply bitvec_AddSub_1624 @@ -639,7 +639,7 @@ theorem alive_AddSub_1624 (w : Nat) : AddSub_1624_src w ⊑ AddSub_1624_tgt w %r = xor %a, (C1 & C2) -/ -def AndOrXor_135_src (w : Nat) := +def alive_AndOrXor_135_src (w : Nat) := [mlir_icom (w)| { ^bb0(%X : _, %C1 : _, %C2 : _): %v1 = "llvm.xor" (%X,%C1) : (_, _) -> (_) @@ -647,7 +647,7 @@ def AndOrXor_135_src (w : Nat) := "llvm.return" (%v2) : (_) -> () }] -def AndOrXor_135_tgt (w : Nat):= +def alive_AndOrXor_135_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%X : _, %C1 : _, %C2 : _): %v1 = "llvm.and" (%X,%C2) : (_, _) -> (_) @@ -656,8 +656,8 @@ def AndOrXor_135_tgt (w : Nat):= %v4 = "llvm.xor" (%v1,%v3) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_AndOrXor_135 (w : Nat) : AndOrXor_135_src w ⊑ AndOrXor_135_tgt w := by - unfold AndOrXor_135_src AndOrXor_135_tgt +theorem alive_AndOrXor_135 (w : Nat) : alive_AndOrXor_135_src w ⊑ alive_AndOrXor_135_tgt w := by + unfold alive_AndOrXor_135_src alive_AndOrXor_135_tgt simp_alive_peephole apply bitvec_AndOrXor_135 @@ -674,7 +674,7 @@ theorem alive_AndOrXor_135 (w : Nat) : AndOrXor_135_src w ⊑ AndOrXor_135_tgt %r = and %o, C2 -/ -def AndOrXor_144_src (w : Nat) := +def alive_AndOrXor_144_src (w : Nat) := [mlir_icom (w)| { ^bb0(%X : _, %C1 : _, %C2 : _): %v1 = "llvm.or" (%X,%C1) : (_, _) -> (_) @@ -682,7 +682,7 @@ def AndOrXor_144_src (w : Nat) := "llvm.return" (%v2) : (_) -> () }] -def AndOrXor_144_tgt (w : Nat):= +def alive_AndOrXor_144_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%X : _, %C1 : _, %C2 : _): %v1 = "llvm.and" (%C1,%C2) : (_, _) -> (_) @@ -691,8 +691,8 @@ def AndOrXor_144_tgt (w : Nat):= %v4 = "llvm.and" (%v2,%C2) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_AndOrXor_144 (w : Nat) : AndOrXor_144_src w ⊑ AndOrXor_144_tgt w := by - unfold AndOrXor_144_src AndOrXor_144_tgt +theorem alive_AndOrXor_144 (w : Nat) : alive_AndOrXor_144_src w ⊑ alive_AndOrXor_144_tgt w := by + unfold alive_AndOrXor_144_src alive_AndOrXor_144_tgt simp_alive_peephole apply bitvec_AndOrXor_144 @@ -716,7 +716,7 @@ theorem alive_AndOrXor_144 (w : Nat) : AndOrXor_144_src w ⊑ AndOrXor_144_tgt %r = icmp eq %a3, 0 -/ -def AndOrXor_698_src (w : Nat) := +def alive_AndOrXor_698_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %b : _, %d : _): %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) @@ -729,7 +729,7 @@ def AndOrXor_698_src (w : Nat) := "llvm.return" (%v7) : (i1) -> () }] -def AndOrXor_698_tgt (w : Nat):= +def alive_AndOrXor_698_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _, %b : _, %d : _): %v1 = "llvm.or" (%b,%d) : (_, _) -> (_) @@ -744,8 +744,8 @@ def AndOrXor_698_tgt (w : Nat):= %v10 = "llvm.icmp eq " (%v2,%v9) : (_, _) -> (_) "llvm.return" (%v10) : (i1) -> () }] -theorem alive_AndOrXor_698 : AndOrXor_698_src ⊑ AndOrXor_698_tgt := by - unfold AndOrXor_698_src AndOrXor_698_tgt +theorem alive_AndOrXor_698 : alive_AndOrXor_698_src ⊑ alive_AndOrXor_698_tgt := by + unfold alive_AndOrXor_698_src alive_AndOrXor_698_tgt simp_alive_peephole apply bitvec_AndOrXor_698 @@ -769,18 +769,18 @@ theorem alive_AndOrXor_698 : AndOrXor_698_src ⊑ AndOrXor_698_tgt := by %r = icmp eq %a3, %or -/ -def AndOrXor_709_src (w : Nat) := +def alive_AndOrXor_709_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %b : _, %d : _): %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) %v2 = "llvm.and" (%a,%d) : (_, _) -> (_) - %v3 = "llvm.icmp eq " (%v1,%b) : (_, _) -> (_) - %v4 = "llvm.icmp eq " (%v2,%d) : (_, _) -> (_) + %v3 = "llvm.icmp" (%v1,%b) { type = "eq" } : (_, _) -> (_) + %v4 = "llvm.icmp" (%v2,%d) { type = "eq" } : (_, _) -> (_) %v5 = "llvm.and" (%v3,%v4) : (_, _) -> (i1) "llvm.return" (%v5) : (i1) -> () }] -def AndOrXor_709_tgt (w : Nat):= +def alive_AndOrXor_709_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _, %b : _, %d : _): %v1 = "llvm.or" (%b,%d) : (_, _) -> (_) @@ -792,8 +792,8 @@ def AndOrXor_709_tgt (w : Nat):= %v7 = "llvm.icmp eq " (%v2,%v1) : (_, _) -> (_) "llvm.return" (%v7) : (i1) -> () }] -theorem alive_AndOrXor_709 : AndOrXor_709_src ⊑ AndOrXor_709_tgt := by - unfold AndOrXor_709_src AndOrXor_709_tgt +theorem alive_AndOrXor_709 : alive_AndOrXor_709_src ⊑ alive_AndOrXor_709_tgt := by + unfold alive_AndOrXor_709_src alive_AndOrXor_709_tgt simp_alive_peephole apply bitvec_AndOrXor_709 @@ -817,7 +817,7 @@ theorem alive_AndOrXor_709 : AndOrXor_709_src ⊑ AndOrXor_709_tgt := by %r = icmp eq %a3, %a -/ -def AndOrXor_716_src (w : Nat) := +def alive_AndOrXor_716_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %b : _, %d : _): %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) @@ -828,7 +828,7 @@ def AndOrXor_716_src (w : Nat) := "llvm.return" (%v5) : (i1) -> () }] -def AndOrXor_716_tgt (w : Nat):= +def alive_AndOrXor_716_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _, %b : _, %d : _): %v1 = "llvm.and" (%b,%d) : (_, _) -> (_) @@ -840,8 +840,8 @@ def AndOrXor_716_tgt (w : Nat):= %v7 = "llvm.icmp eq " (%v2,%a) : (_, _) -> (_) "llvm.return" (%v7) : (i1) -> () }] -theorem alive_AndOrXor_716 : AndOrXor_716_src ⊑ AndOrXor_716_tgt := by - unfold AndOrXor_716_src AndOrXor_716_tgt +theorem alive_AndOrXor_716 : alive_AndOrXor_716_src ⊑ alive_AndOrXor_716_tgt := by + unfold alive_AndOrXor_716_src alive_AndOrXor_716_tgt simp_alive_peephole apply bitvec_AndOrXor_716 @@ -859,7 +859,7 @@ theorem alive_AndOrXor_716 : AndOrXor_716_src ⊑ AndOrXor_716_tgt := by %r = icmp sgt %a, %b -/ -def AndOrXor_794_src (w : Nat) := +def alive_AndOrXor_794_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.icmp sgt " (%a,%b) : (_, _) -> (_) @@ -868,7 +868,7 @@ def AndOrXor_794_src (w : Nat) := "llvm.return" (%v3) : (i1) -> () }] -def AndOrXor_794_tgt (w : Nat):= +def alive_AndOrXor_794_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.icmp sgt " (%a,%b) : (_, _) -> (_) @@ -876,8 +876,8 @@ def AndOrXor_794_tgt (w : Nat):= %v3 = "llvm.icmp sgt " (%a,%b) : (_, _) -> (_) "llvm.return" (%v3) : (i1) -> () }] -theorem alive_AndOrXor_794 : AndOrXor_794_src ⊑ AndOrXor_794_tgt := by - unfold AndOrXor_794_src AndOrXor_794_tgt +theorem alive_AndOrXor_794 : alive_AndOrXor_794_src ⊑ alive_AndOrXor_794_tgt := by + unfold alive_AndOrXor_794_src alive_AndOrXor_794_tgt simp_alive_peephole apply bitvec_AndOrXor_794 @@ -896,7 +896,7 @@ theorem alive_AndOrXor_794 : AndOrXor_794_src ⊑ AndOrXor_794_tgt := by %r = icmp eq %o, 0 -/ -def AndOrXor_827_src (w : Nat) := +def alive_AndOrXor_827_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) @@ -907,7 +907,7 @@ def AndOrXor_827_src (w : Nat) := "llvm.return" (%v5) : (i1) -> () }] -def AndOrXor_827_tgt (w : Nat):= +def alive_AndOrXor_827_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.or" (%a,%b) : (_, _) -> (_) @@ -919,8 +919,8 @@ def AndOrXor_827_tgt (w : Nat):= %v7 = "llvm.icmp eq " (%v1,%v6) : (_, _) -> (_) "llvm.return" (%v7) : (i1) -> () }] -theorem alive_AndOrXor_827 : AndOrXor_827_src ⊑ AndOrXor_827_tgt := by - unfold AndOrXor_827_src AndOrXor_827_tgt +theorem alive_AndOrXor_827 : alive_AndOrXor_827_src ⊑ alive_AndOrXor_827_tgt := by + unfold alive_AndOrXor_827_src alive_AndOrXor_827_tgt simp_alive_peephole apply bitvec_AndOrXor_827 @@ -938,7 +938,7 @@ theorem alive_AndOrXor_827 : AndOrXor_827_src ⊑ AndOrXor_827_tgt := by %r = false -/ -def AndOrXor_887_2_src (w : Nat) := +def alive_AndOrXor_887_2_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %C1 : _): %v1 = "llvm.icmp eq " (%a,%C1) : (_, _) -> (_) @@ -947,7 +947,7 @@ def AndOrXor_887_2_src (w : Nat) := "llvm.return" (%v3) : (i1) -> () }] -def AndOrXor_887_2_tgt (w : Nat):= +def alive_AndOrXor_887_2_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _, %C1 : _): %v1 = "llvm.icmp eq " (%a,%C1) : (_, _) -> (_) @@ -956,8 +956,8 @@ def AndOrXor_887_2_tgt (w : Nat):= %v4 = "llvm.copy" (%v3) : (i1) -> (i1) "llvm.return" (%v4) : (i1) -> () }] -theorem alive_AndOrXor_887_2 : AndOrXor_887_2_src ⊑ AndOrXor_887_2_tgt := by - unfold AndOrXor_887_2_src AndOrXor_887_2_tgt +theorem alive_AndOrXor_887_2 : alive_AndOrXor_887_2_src ⊑ alive_AndOrXor_887_2_tgt := by + unfold alive_AndOrXor_887_2_src alive_AndOrXor_887_2_tgt simp_alive_peephole apply bitvec_AndOrXor_887_2 @@ -976,7 +976,7 @@ theorem alive_AndOrXor_887_2 : AndOrXor_887_2_src ⊑ AndOrXor_887_2_tgt := by %r = xor %or, -1 -/ -def AndOrXor_1230__A__B___A__B_src (w : Nat) := +def alive_AndOrXor_1230__A__B___A__B_src (w : Nat) := [mlir_icom (w)| { ^bb0(%notOp0 : _, %notOp1 : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -987,7 +987,7 @@ def AndOrXor_1230__A__B___A__B_src (w : Nat) := "llvm.return" (%v5) : (_) -> () }] -def AndOrXor_1230__A__B___A__B_tgt (w : Nat):= +def alive_AndOrXor_1230__A__B___A__B_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%notOp0 : _, %notOp1 : _): %v1 = "llvm.or" (%notOp0,%notOp1) : (_, _) -> (_) @@ -999,8 +999,8 @@ def AndOrXor_1230__A__B___A__B_tgt (w : Nat):= %v7 = "llvm.xor" (%v1,%v6) : (_, _) -> (_) "llvm.return" (%v7) : (_) -> () }] -theorem alive_AndOrXor_1230__A__B___A__B (w : Nat) : AndOrXor_1230__A__B___A__B_src w ⊑ AndOrXor_1230__A__B___A__B_tgt w := by - unfold AndOrXor_1230__A__B___A__B_src AndOrXor_1230__A__B___A__B_tgt +theorem alive_AndOrXor_1230__A__B___A__B (w : Nat) : alive_AndOrXor_1230__A__B___A__B_src w ⊑ alive_AndOrXor_1230__A__B___A__B_tgt w := by + unfold alive_AndOrXor_1230__A__B___A__B_src alive_AndOrXor_1230__A__B___A__B_tgt simp_alive_peephole apply bitvec_AndOrXor_1230__A__B___A__B @@ -1020,7 +1020,7 @@ theorem alive_AndOrXor_1230__A__B___A__B (w : Nat) : AndOrXor_1230__A__B___A__B %r = xor %A, %B -/ -def AndOrXor_1241_AB__AB__AB_src (w : Nat) := +def alive_AndOrXor_1241_AB__AB__AB_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.or" (%A,%B) : (_, _) -> (_) @@ -1031,7 +1031,7 @@ def AndOrXor_1241_AB__AB__AB_src (w : Nat) := "llvm.return" (%v5) : (_) -> () }] -def AndOrXor_1241_AB__AB__AB_tgt (w : Nat):= +def alive_AndOrXor_1241_AB__AB__AB_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.or" (%A,%B) : (_, _) -> (_) @@ -1041,8 +1041,8 @@ def AndOrXor_1241_AB__AB__AB_tgt (w : Nat):= %v5 = "llvm.xor" (%A,%B) : (_, _) -> (_) "llvm.return" (%v5) : (_) -> () }] -theorem alive_AndOrXor_1241_AB__AB__AB (w : Nat) : AndOrXor_1241_AB__AB__AB_src w ⊑ AndOrXor_1241_AB__AB__AB_tgt w := by - unfold AndOrXor_1241_AB__AB__AB_src AndOrXor_1241_AB__AB__AB_tgt +theorem alive_AndOrXor_1241_AB__AB__AB (w : Nat) : alive_AndOrXor_1241_AB__AB__AB_src w ⊑ alive_AndOrXor_1241_AB__AB__AB_tgt w := by + unfold alive_AndOrXor_1241_AB__AB__AB_src alive_AndOrXor_1241_AB__AB__AB_tgt simp_alive_peephole apply bitvec_AndOrXor_1241_AB__AB__AB @@ -1062,7 +1062,7 @@ theorem alive_AndOrXor_1241_AB__AB__AB (w : Nat) : AndOrXor_1241_AB__AB__AB_src %r = xor %A, %B -/ -def AndOrXor_1247_AB__AB__AB_src (w : Nat) := +def alive_AndOrXor_1247_AB__AB__AB_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.and" (%A,%B) : (_, _) -> (_) @@ -1073,7 +1073,7 @@ def AndOrXor_1247_AB__AB__AB_src (w : Nat) := "llvm.return" (%v5) : (_) -> () }] -def AndOrXor_1247_AB__AB__AB_tgt (w : Nat):= +def alive_AndOrXor_1247_AB__AB__AB_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.and" (%A,%B) : (_, _) -> (_) @@ -1083,8 +1083,8 @@ def AndOrXor_1247_AB__AB__AB_tgt (w : Nat):= %v5 = "llvm.xor" (%A,%B) : (_, _) -> (_) "llvm.return" (%v5) : (_) -> () }] -theorem alive_AndOrXor_1247_AB__AB__AB (w : Nat) : AndOrXor_1247_AB__AB__AB_src w ⊑ AndOrXor_1247_AB__AB__AB_tgt w := by - unfold AndOrXor_1247_AB__AB__AB_src AndOrXor_1247_AB__AB__AB_tgt +theorem alive_AndOrXor_1247_AB__AB__AB (w : Nat) : alive_AndOrXor_1247_AB__AB__AB_src w ⊑ alive_AndOrXor_1247_AB__AB__AB_tgt w := by + unfold alive_AndOrXor_1247_AB__AB__AB_src alive_AndOrXor_1247_AB__AB__AB_tgt simp_alive_peephole apply bitvec_AndOrXor_1247_AB__AB__AB @@ -1101,7 +1101,7 @@ theorem alive_AndOrXor_1247_AB__AB__AB (w : Nat) : AndOrXor_1247_AB__AB__AB_src %r = and %A, %notB -/ -def AndOrXor_1253_A__AB___A__B_src (w : Nat) := +def alive_AndOrXor_1253_A__AB___A__B_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.xor" (%A,%B) : (_, _) -> (_) @@ -1109,7 +1109,7 @@ def AndOrXor_1253_A__AB___A__B_src (w : Nat) := "llvm.return" (%v2) : (_) -> () }] -def AndOrXor_1253_A__AB___A__B_tgt (w : Nat):= +def alive_AndOrXor_1253_A__AB___A__B_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -1118,8 +1118,8 @@ def AndOrXor_1253_A__AB___A__B_tgt (w : Nat):= %v4 = "llvm.and" (%A,%v2) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_AndOrXor_1253_A__AB___A__B (w : Nat) : AndOrXor_1253_A__AB___A__B_src w ⊑ AndOrXor_1253_A__AB___A__B_tgt w := by - unfold AndOrXor_1253_A__AB___A__B_src AndOrXor_1253_A__AB___A__B_tgt +theorem alive_AndOrXor_1253_A__AB___A__B (w : Nat) : alive_AndOrXor_1253_A__AB___A__B_src w ⊑ alive_AndOrXor_1253_A__AB___A__B_tgt w := by + unfold alive_AndOrXor_1253_A__AB___A__B_src alive_AndOrXor_1253_A__AB___A__B_tgt simp_alive_peephole apply bitvec_AndOrXor_1253_A__AB___A__B @@ -1137,7 +1137,7 @@ theorem alive_AndOrXor_1253_A__AB___A__B (w : Nat) : AndOrXor_1253_A__AB___A__B %r = and %A, %B -/ -def AndOrXor_1280_ABA___AB_src (w : Nat) := +def alive_AndOrXor_1280_ABA___AB_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -1147,7 +1147,7 @@ def AndOrXor_1280_ABA___AB_src (w : Nat) := "llvm.return" (%v4) : (_) -> () }] -def AndOrXor_1280_ABA___AB_tgt (w : Nat):= +def alive_AndOrXor_1280_ABA___AB_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -1156,8 +1156,8 @@ def AndOrXor_1280_ABA___AB_tgt (w : Nat):= %v4 = "llvm.and" (%A,%B) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_AndOrXor_1280_ABA___AB (w : Nat) : AndOrXor_1280_ABA___AB_src w ⊑ AndOrXor_1280_ABA___AB_tgt w := by - unfold AndOrXor_1280_ABA___AB_src AndOrXor_1280_ABA___AB_tgt +theorem alive_AndOrXor_1280_ABA___AB (w : Nat) : alive_AndOrXor_1280_ABA___AB_src w ⊑ alive_AndOrXor_1280_ABA___AB_tgt w := by + unfold alive_AndOrXor_1280_ABA___AB_src alive_AndOrXor_1280_ABA___AB_tgt simp_alive_peephole apply bitvec_AndOrXor_1280_ABA___AB @@ -1178,7 +1178,7 @@ theorem alive_AndOrXor_1280_ABA___AB (w : Nat) : AndOrXor_1280_ABA___AB_src w %r = and %op0, %negC -/ -def AndOrXor_1288_A__B__B__C__A___A__B__C_src (w : Nat) := +def alive_AndOrXor_1288_A__B__B__C__A___A__B__C_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %C : _, %B : _): %v1 = "llvm.xor" (%A,%B) : (_, _) -> (_) @@ -1188,7 +1188,7 @@ def AndOrXor_1288_A__B__B__C__A___A__B__C_src (w : Nat) := "llvm.return" (%v4) : (_) -> () }] -def AndOrXor_1288_A__B__B__C__A___A__B__C_tgt (w : Nat):= +def alive_AndOrXor_1288_A__B__B__C__A___A__B__C_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %C : _, %B : _): %v1 = "llvm.xor" (%A,%B) : (_, _) -> (_) @@ -1199,8 +1199,8 @@ def AndOrXor_1288_A__B__B__C__A___A__B__C_tgt (w : Nat):= %v6 = "llvm.and" (%v1,%v3) : (_, _) -> (_) "llvm.return" (%v6) : (_) -> () }] -theorem alive_AndOrXor_1288_A__B__B__C__A___A__B__C (w : Nat) : AndOrXor_1288_A__B__B__C__A___A__B__C_src w ⊑ AndOrXor_1288_A__B__B__C__A___A__B__C_tgt w := by - unfold AndOrXor_1288_A__B__B__C__A___A__B__C_src AndOrXor_1288_A__B__B__C__A___A__B__C_tgt +theorem alive_AndOrXor_1288_A__B__B__C__A___A__B__C (w : Nat) : alive_AndOrXor_1288_A__B__B__C__A___A__B__C_src w ⊑ alive_AndOrXor_1288_A__B__B__C__A___A__B__C_tgt w := by + unfold alive_AndOrXor_1288_A__B__B__C__A___A__B__C_src alive_AndOrXor_1288_A__B__B__C__A___A__B__C_tgt simp_alive_peephole apply bitvec_AndOrXor_1288_A__B__B__C__A___A__B__C @@ -1220,7 +1220,7 @@ theorem alive_AndOrXor_1288_A__B__B__C__A___A__B__C (w : Nat) : AndOrXor_1288_A %r = and %A, %B -/ -def AndOrXor_1294_A__B__A__B___A__B_src (w : Nat) := +def alive_AndOrXor_1294_A__B__A__B___A__B_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.or" (%A,%B) : (_, _) -> (_) @@ -1231,7 +1231,7 @@ def AndOrXor_1294_A__B__A__B___A__B_src (w : Nat) := "llvm.return" (%v5) : (_) -> () }] -def AndOrXor_1294_A__B__A__B___A__B_tgt (w : Nat):= +def alive_AndOrXor_1294_A__B__A__B___A__B_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.or" (%A,%B) : (_, _) -> (_) @@ -1241,8 +1241,8 @@ def AndOrXor_1294_A__B__A__B___A__B_tgt (w : Nat):= %v5 = "llvm.and" (%A,%B) : (_, _) -> (_) "llvm.return" (%v5) : (_) -> () }] -theorem alive_AndOrXor_1294_A__B__A__B___A__B (w : Nat) : AndOrXor_1294_A__B__A__B___A__B_src w ⊑ AndOrXor_1294_A__B__A__B___A__B_tgt w := by - unfold AndOrXor_1294_A__B__A__B___A__B_src AndOrXor_1294_A__B__A__B___A__B_tgt +theorem alive_AndOrXor_1294_A__B__A__B___A__B (w : Nat) : alive_AndOrXor_1294_A__B__A__B___A__B_src w ⊑ alive_AndOrXor_1294_A__B__A__B___A__B_tgt w := by + unfold alive_AndOrXor_1294_A__B__A__B___A__B_src alive_AndOrXor_1294_A__B__A__B___A__B_tgt simp_alive_peephole apply bitvec_AndOrXor_1294_A__B__A__B___A__B @@ -1260,7 +1260,7 @@ theorem alive_AndOrXor_1294_A__B__A__B___A__B (w : Nat) : AndOrXor_1294_A__B__A %r = icmp uge %a, %b -/ -def AndOrXor_1683_1_src (w : Nat) := +def alive_AndOrXor_1683_1_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.icmp ugt " (%a,%b) : (_, _) -> (_) @@ -1269,7 +1269,7 @@ def AndOrXor_1683_1_src (w : Nat) := "llvm.return" (%v3) : (i1) -> () }] -def AndOrXor_1683_1_tgt (w : Nat):= +def alive_AndOrXor_1683_1_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.icmp ugt " (%a,%b) : (_, _) -> (_) @@ -1277,8 +1277,8 @@ def AndOrXor_1683_1_tgt (w : Nat):= %v3 = "llvm.icmp uge " (%a,%b) : (_, _) -> (_) "llvm.return" (%v3) : (i1) -> () }] -theorem alive_AndOrXor_1683_1 : AndOrXor_1683_1_src ⊑ AndOrXor_1683_1_tgt := by - unfold AndOrXor_1683_1_src AndOrXor_1683_1_tgt +theorem alive_AndOrXor_1683_1 : alive_AndOrXor_1683_1_src ⊑ alive_AndOrXor_1683_1_tgt := by + unfold alive_AndOrXor_1683_1_src alive_AndOrXor_1683_1_tgt simp_alive_peephole apply bitvec_AndOrXor_1683_1 @@ -1296,7 +1296,7 @@ theorem alive_AndOrXor_1683_1 : AndOrXor_1683_1_src ⊑ AndOrXor_1683_1_tgt := b %r = true -/ -def AndOrXor_1683_2_src (w : Nat) := +def alive_AndOrXor_1683_2_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.icmp uge " (%a,%b) : (_, _) -> (_) @@ -1305,7 +1305,7 @@ def AndOrXor_1683_2_src (w : Nat) := "llvm.return" (%v3) : (i1) -> () }] -def AndOrXor_1683_2_tgt (w : Nat):= +def alive_AndOrXor_1683_2_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.icmp uge " (%a,%b) : (_, _) -> (_) @@ -1314,8 +1314,8 @@ def AndOrXor_1683_2_tgt (w : Nat):= %v4 = "llvm.copy" (%v3) : (i1) -> (i1) "llvm.return" (%v4) : (i1) -> () }] -theorem alive_AndOrXor_1683_2 : AndOrXor_1683_2_src ⊑ AndOrXor_1683_2_tgt := by - unfold AndOrXor_1683_2_src AndOrXor_1683_2_tgt +theorem alive_AndOrXor_1683_2 : alive_AndOrXor_1683_2_src ⊑ alive_AndOrXor_1683_2_tgt := by + unfold alive_AndOrXor_1683_2_src alive_AndOrXor_1683_2_tgt simp_alive_peephole apply bitvec_AndOrXor_1683_2 @@ -1334,7 +1334,7 @@ theorem alive_AndOrXor_1683_2 : AndOrXor_1683_2_src ⊑ AndOrXor_1683_2_tgt := b %r = icmp uge %b1, %A -/ -def AndOrXor_1704_src (w : Nat) := +def alive_AndOrXor_1704_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) @@ -1344,7 +1344,7 @@ def AndOrXor_1704_src (w : Nat) := "llvm.return" (%v4) : (i1) -> () }] -def AndOrXor_1704_tgt (w : Nat):= +def alive_AndOrXor_1704_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -1355,8 +1355,8 @@ def AndOrXor_1704_tgt (w : Nat):= %v6 = "llvm.icmp uge " (%v2,%A) : (_, _) -> (_) "llvm.return" (%v6) : (i1) -> () }] -theorem alive_AndOrXor_1704 : AndOrXor_1704_src ⊑ AndOrXor_1704_tgt := by - unfold AndOrXor_1704_src AndOrXor_1704_tgt +theorem alive_AndOrXor_1704 : alive_AndOrXor_1704_src ⊑ alive_AndOrXor_1704_tgt := by + unfold alive_AndOrXor_1704_src alive_AndOrXor_1704_tgt simp_alive_peephole apply bitvec_AndOrXor_1704 @@ -1375,7 +1375,7 @@ theorem alive_AndOrXor_1704 : AndOrXor_1704_src ⊑ AndOrXor_1704_tgt := by %r = icmp uge %b1, %A -/ -def AndOrXor_1705_src (w : Nat) := +def alive_AndOrXor_1705_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) @@ -1385,7 +1385,7 @@ def AndOrXor_1705_src (w : Nat) := "llvm.return" (%v4) : (i1) -> () }] -def AndOrXor_1705_tgt (w : Nat):= +def alive_AndOrXor_1705_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -1396,8 +1396,8 @@ def AndOrXor_1705_tgt (w : Nat):= %v6 = "llvm.icmp uge " (%v2,%A) : (_, _) -> (_) "llvm.return" (%v6) : (i1) -> () }] -theorem alive_AndOrXor_1705 : AndOrXor_1705_src ⊑ AndOrXor_1705_tgt := by - unfold AndOrXor_1705_src AndOrXor_1705_tgt +theorem alive_AndOrXor_1705 : alive_AndOrXor_1705_src ⊑ alive_AndOrXor_1705_tgt := by + unfold alive_AndOrXor_1705_src alive_AndOrXor_1705_tgt simp_alive_peephole apply bitvec_AndOrXor_1705 @@ -1416,7 +1416,7 @@ theorem alive_AndOrXor_1705 : AndOrXor_1705_src ⊑ AndOrXor_1705_tgt := by %r = icmp ne %or, 0 -/ -def AndOrXor_1733_src (w : Nat) := +def alive_AndOrXor_1733_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) @@ -1427,7 +1427,7 @@ def AndOrXor_1733_src (w : Nat) := "llvm.return" (%v5) : (i1) -> () }] -def AndOrXor_1733_tgt (w : Nat):= +def alive_AndOrXor_1733_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.or" (%A,%B) : (_, _) -> (_) @@ -1439,8 +1439,8 @@ def AndOrXor_1733_tgt (w : Nat):= %v7 = "llvm.icmp ne " (%v1,%v6) : (_, _) -> (_) "llvm.return" (%v7) : (i1) -> () }] -theorem alive_AndOrXor_1733 : AndOrXor_1733_src ⊑ AndOrXor_1733_tgt := by - unfold AndOrXor_1733_src AndOrXor_1733_tgt +theorem alive_AndOrXor_1733 : alive_AndOrXor_1733_src ⊑ alive_AndOrXor_1733_tgt := by + unfold alive_AndOrXor_1733_src alive_AndOrXor_1733_tgt simp_alive_peephole apply bitvec_AndOrXor_1733 @@ -1457,7 +1457,7 @@ theorem alive_AndOrXor_1733 : AndOrXor_1733_src ⊑ AndOrXor_1733_tgt := by %r = xor %or, (C1 & ~C) -/ -def AndOrXor_2063__X__C1__C2____X__C2__C1__C2_src (w : Nat) := +def alive_AndOrXor_2063__X__C1__C2____X__C2__C1__C2_src (w : Nat) := [mlir_icom (w)| { ^bb0(%x : _, %C1 : _, %C : _): %v1 = "llvm.xor" (%x,%C1) : (_, _) -> (_) @@ -1465,7 +1465,7 @@ def AndOrXor_2063__X__C1__C2____X__C2__C1__C2_src (w : Nat) := "llvm.return" (%v2) : (_) -> () }] -def AndOrXor_2063__X__C1__C2____X__C2__C1__C2_tgt (w : Nat):= +def alive_AndOrXor_2063__X__C1__C2____X__C2__C1__C2_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%x : _, %C1 : _, %C : _): %v1 = "llvm.or" (%x,%C) : (_, _) -> (_) @@ -1475,8 +1475,8 @@ def AndOrXor_2063__X__C1__C2____X__C2__C1__C2_tgt (w : Nat):= %v5 = "llvm.xor" (%v1,%v4) : (_, _) -> (_) "llvm.return" (%v5) : (_) -> () }] -theorem alive_AndOrXor_2063__X__C1__C2____X__C2__C1__C2 (w : Nat) : AndOrXor_2063__X__C1__C2____X__C2__C1__C2_src w ⊑ AndOrXor_2063__X__C1__C2____X__C2__C1__C2_tgt w := by - unfold AndOrXor_2063__X__C1__C2____X__C2__C1__C2_src AndOrXor_2063__X__C1__C2____X__C2__C1__C2_tgt +theorem alive_AndOrXor_2063__X__C1__C2____X__C2__C1__C2 (w : Nat) : alive_AndOrXor_2063__X__C1__C2____X__C2__C1__C2_src w ⊑ alive_AndOrXor_2063__X__C1__C2____X__C2__C1__C2_tgt w := by + unfold alive_AndOrXor_2063__X__C1__C2____X__C2__C1__C2_src alive_AndOrXor_2063__X__C1__C2____X__C2__C1__C2_tgt simp_alive_peephole apply bitvec_AndOrXor_2063__X__C1__C2____X__C2__C1__C2 @@ -1494,7 +1494,7 @@ theorem alive_AndOrXor_2063__X__C1__C2____X__C2__C1__C2 (w : Nat) : AndOrXor_20 %r = or %A, %B -/ -def AndOrXor_2113___A__B__A___A__B_src (w : Nat) := +def alive_AndOrXor_2113___A__B__A___A__B_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -1504,7 +1504,7 @@ def AndOrXor_2113___A__B__A___A__B_src (w : Nat) := "llvm.return" (%v4) : (_) -> () }] -def AndOrXor_2113___A__B__A___A__B_tgt (w : Nat):= +def alive_AndOrXor_2113___A__B__A___A__B_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -1513,8 +1513,8 @@ def AndOrXor_2113___A__B__A___A__B_tgt (w : Nat):= %v4 = "llvm.or" (%A,%B) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_AndOrXor_2113___A__B__A___A__B (w : Nat) : AndOrXor_2113___A__B__A___A__B_src w ⊑ AndOrXor_2113___A__B__A___A__B_tgt w := by - unfold AndOrXor_2113___A__B__A___A__B_src AndOrXor_2113___A__B__A___A__B_tgt +theorem alive_AndOrXor_2113___A__B__A___A__B (w : Nat) : alive_AndOrXor_2113___A__B__A___A__B_src w ⊑ alive_AndOrXor_2113___A__B__A___A__B_tgt w := by + unfold alive_AndOrXor_2113___A__B__A___A__B_src alive_AndOrXor_2113___A__B__A___A__B_tgt simp_alive_peephole apply bitvec_AndOrXor_2113___A__B__A___A__B @@ -1532,7 +1532,7 @@ theorem alive_AndOrXor_2113___A__B__A___A__B (w : Nat) : AndOrXor_2113___A__B__ %r = or %negA, %B -/ -def AndOrXor_2118___A__B__A___A__B_src (w : Nat) := +def alive_AndOrXor_2118___A__B__A___A__B_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -1542,7 +1542,7 @@ def AndOrXor_2118___A__B__A___A__B_src (w : Nat) := "llvm.return" (%v4) : (_) -> () }] -def AndOrXor_2118___A__B__A___A__B_tgt (w : Nat):= +def alive_AndOrXor_2118___A__B__A___A__B_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -1551,8 +1551,8 @@ def AndOrXor_2118___A__B__A___A__B_tgt (w : Nat):= %v4 = "llvm.or" (%v2,%B) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_AndOrXor_2118___A__B__A___A__B (w : Nat) : AndOrXor_2118___A__B__A___A__B_src w ⊑ AndOrXor_2118___A__B__A___A__B_tgt w := by - unfold AndOrXor_2118___A__B__A___A__B_src AndOrXor_2118___A__B__A___A__B_tgt +theorem alive_AndOrXor_2118___A__B__A___A__B (w : Nat) : alive_AndOrXor_2118___A__B__A___A__B_src w ⊑ alive_AndOrXor_2118___A__B__A___A__B_tgt w := by + unfold alive_AndOrXor_2118___A__B__A___A__B_src alive_AndOrXor_2118___A__B__A___A__B_tgt simp_alive_peephole apply bitvec_AndOrXor_2118___A__B__A___A__B @@ -1572,7 +1572,7 @@ theorem alive_AndOrXor_2118___A__B__A___A__B (w : Nat) : AndOrXor_2118___A__B__ %r = xor %A, %B -/ -def AndOrXor_2123___A__B__A__B___A__B_src (w : Nat) := +def alive_AndOrXor_2123___A__B__A__B___A__B_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -1583,7 +1583,7 @@ def AndOrXor_2123___A__B__A__B___A__B_src (w : Nat) := "llvm.return" (%v5) : (_) -> () }] -def AndOrXor_2123___A__B__A__B___A__B_tgt (w : Nat):= +def alive_AndOrXor_2123___A__B__A__B___A__B_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -1593,8 +1593,8 @@ def AndOrXor_2123___A__B__A__B___A__B_tgt (w : Nat):= %v5 = "llvm.xor" (%A,%B) : (_, _) -> (_) "llvm.return" (%v5) : (_) -> () }] -theorem alive_AndOrXor_2123___A__B__A__B___A__B (w : Nat) : AndOrXor_2123___A__B__A__B___A__B_src w ⊑ AndOrXor_2123___A__B__A__B___A__B_tgt w := by - unfold AndOrXor_2123___A__B__A__B___A__B_src AndOrXor_2123___A__B__A__B___A__B_tgt +theorem alive_AndOrXor_2123___A__B__A__B___A__B (w : Nat) : alive_AndOrXor_2123___A__B__A__B___A__B_src w ⊑ alive_AndOrXor_2123___A__B__A__B___A__B_tgt w := by + unfold alive_AndOrXor_2123___A__B__A__B___A__B_src alive_AndOrXor_2123___A__B__A__B___A__B_tgt simp_alive_peephole apply bitvec_AndOrXor_2123___A__B__A__B___A__B @@ -1616,7 +1616,7 @@ theorem alive_AndOrXor_2123___A__B__A__B___A__B (w : Nat) : AndOrXor_2123___A__ %r = xor %A, %D -/ -def AndOrXor_2188_src (w : Nat) := +def alive_AndOrXor_2188_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %D : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -1629,7 +1629,7 @@ def AndOrXor_2188_src (w : Nat) := "llvm.return" (%v7) : (_) -> () }] -def AndOrXor_2188_tgt (w : Nat):= +def alive_AndOrXor_2188_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %D : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -1641,8 +1641,8 @@ def AndOrXor_2188_tgt (w : Nat):= %v7 = "llvm.xor" (%A,%D) : (_, _) -> (_) "llvm.return" (%v7) : (_) -> () }] -theorem alive_AndOrXor_2188 (w : Nat) : AndOrXor_2188_src w ⊑ AndOrXor_2188_tgt w := by - unfold AndOrXor_2188_src AndOrXor_2188_tgt +theorem alive_AndOrXor_2188 (w : Nat) : alive_AndOrXor_2188_src w ⊑ alive_AndOrXor_2188_tgt w := by + unfold alive_AndOrXor_2188_src alive_AndOrXor_2188_tgt simp_alive_peephole apply bitvec_AndOrXor_2188 @@ -1662,7 +1662,7 @@ theorem alive_AndOrXor_2188 (w : Nat) : AndOrXor_2188_src w ⊑ AndOrXor_2188_ %r = or %op0, %C -/ -def AndOrXor_2231__A__B__B__C__A___A__B__C_src (w : Nat) := +def alive_AndOrXor_2231__A__B__B__C__A___A__B__C_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %C : _, %B : _): %v1 = "llvm.xor" (%A,%B) : (_, _) -> (_) @@ -1672,7 +1672,7 @@ def AndOrXor_2231__A__B__B__C__A___A__B__C_src (w : Nat) := "llvm.return" (%v4) : (_) -> () }] -def AndOrXor_2231__A__B__B__C__A___A__B__C_tgt (w : Nat):= +def alive_AndOrXor_2231__A__B__B__C__A___A__B__C_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %C : _, %B : _): %v1 = "llvm.xor" (%A,%B) : (_, _) -> (_) @@ -1681,8 +1681,8 @@ def AndOrXor_2231__A__B__B__C__A___A__B__C_tgt (w : Nat):= %v4 = "llvm.or" (%v1,%C) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_AndOrXor_2231__A__B__B__C__A___A__B__C (w : Nat) : AndOrXor_2231__A__B__B__C__A___A__B__C_src w ⊑ AndOrXor_2231__A__B__B__C__A___A__B__C_tgt w := by - unfold AndOrXor_2231__A__B__B__C__A___A__B__C_src AndOrXor_2231__A__B__B__C__A___A__B__C_tgt +theorem alive_AndOrXor_2231__A__B__B__C__A___A__B__C (w : Nat) : alive_AndOrXor_2231__A__B__B__C__A___A__B__C_src w ⊑ alive_AndOrXor_2231__A__B__B__C__A___A__B__C_tgt w := by + unfold alive_AndOrXor_2231__A__B__B__C__A___A__B__C_src alive_AndOrXor_2231__A__B__B__C__A___A__B__C_tgt simp_alive_peephole apply bitvec_AndOrXor_2231__A__B__B__C__A___A__B__C @@ -1701,7 +1701,7 @@ theorem alive_AndOrXor_2231__A__B__B__C__A___A__B__C (w : Nat) : AndOrXor_2231_ %r = or %B, %a -/ -def AndOrXor_2243__B__C__A__B___B__A__C_src (w : Nat) := +def alive_AndOrXor_2243__B__C__A__B___B__A__C_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %C : _, %B : _): %v1 = "llvm.or" (%B,%C) : (_, _) -> (_) @@ -1710,7 +1710,7 @@ def AndOrXor_2243__B__C__A__B___B__A__C_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def AndOrXor_2243__B__C__A__B___B__A__C_tgt (w : Nat):= +def alive_AndOrXor_2243__B__C__A__B___B__A__C_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %C : _, %B : _): %v1 = "llvm.and" (%A,%C) : (_, _) -> (_) @@ -1719,8 +1719,8 @@ def AndOrXor_2243__B__C__A__B___B__A__C_tgt (w : Nat):= %v4 = "llvm.or" (%B,%v1) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_AndOrXor_2243__B__C__A__B___B__A__C (w : Nat) : AndOrXor_2243__B__C__A__B___B__A__C_src w ⊑ AndOrXor_2243__B__C__A__B___B__A__C_tgt w := by - unfold AndOrXor_2243__B__C__A__B___B__A__C_src AndOrXor_2243__B__C__A__B___B__A__C_tgt +theorem alive_AndOrXor_2243__B__C__A__B___B__A__C (w : Nat) : alive_AndOrXor_2243__B__C__A__B___B__A__C_src w ⊑ alive_AndOrXor_2243__B__C__A__B___B__A__C_tgt w := by + unfold alive_AndOrXor_2243__B__C__A__B___B__A__C_src alive_AndOrXor_2243__B__C__A__B___B__A__C_tgt simp_alive_peephole apply bitvec_AndOrXor_2243__B__C__A__B___B__A__C @@ -1739,7 +1739,7 @@ theorem alive_AndOrXor_2243__B__C__A__B___B__A__C (w : Nat) : AndOrXor_2243__B_ %r = xor %a, -1 -/ -def AndOrXor_2247__A__B__A__B_src (w : Nat) := +def alive_AndOrXor_2247__A__B__A__B_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -1750,7 +1750,7 @@ def AndOrXor_2247__A__B__A__B_src (w : Nat) := "llvm.return" (%v5) : (_) -> () }] -def AndOrXor_2247__A__B__A__B_tgt (w : Nat):= +def alive_AndOrXor_2247__A__B__A__B_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.and" (%A,%B) : (_, _) -> (_) @@ -1762,8 +1762,8 @@ def AndOrXor_2247__A__B__A__B_tgt (w : Nat):= %v7 = "llvm.xor" (%v1,%v6) : (_, _) -> (_) "llvm.return" (%v7) : (_) -> () }] -theorem alive_AndOrXor_2247__A__B__A__B (w : Nat) : AndOrXor_2247__A__B__A__B_src w ⊑ AndOrXor_2247__A__B__A__B_tgt w := by - unfold AndOrXor_2247__A__B__A__B_src AndOrXor_2247__A__B__A__B_tgt +theorem alive_AndOrXor_2247__A__B__A__B (w : Nat) : alive_AndOrXor_2247__A__B__A__B_src w ⊑ alive_AndOrXor_2247__A__B__A__B_tgt w := by + unfold alive_AndOrXor_2247__A__B__A__B_src alive_AndOrXor_2247__A__B__A__B_tgt simp_alive_peephole apply bitvec_AndOrXor_2247__A__B__A__B @@ -1779,7 +1779,7 @@ theorem alive_AndOrXor_2247__A__B__A__B (w : Nat) : AndOrXor_2247__A__B__A__B_s %r = or %op0, %B -/ -def AndOrXor_2263_src (w : Nat) := +def alive_AndOrXor_2263_src (w : Nat) := [mlir_icom (w)| { ^bb0(%B : _, %op0 : _): %v1 = "llvm.xor" (%op0,%B) : (_, _) -> (_) @@ -1787,15 +1787,15 @@ def AndOrXor_2263_src (w : Nat) := "llvm.return" (%v2) : (_) -> () }] -def AndOrXor_2263_tgt (w : Nat):= +def alive_AndOrXor_2263_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%B : _, %op0 : _): %v1 = "llvm.xor" (%op0,%B) : (_, _) -> (_) %v2 = "llvm.or" (%op0,%B) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -theorem alive_AndOrXor_2263 (w : Nat) : AndOrXor_2263_src w ⊑ AndOrXor_2263_tgt w := by - unfold AndOrXor_2263_src AndOrXor_2263_tgt +theorem alive_AndOrXor_2263 (w : Nat) : alive_AndOrXor_2263_src w ⊑ alive_AndOrXor_2263_tgt w := by + unfold alive_AndOrXor_2263_src alive_AndOrXor_2263_tgt simp_alive_peephole apply bitvec_AndOrXor_2263 @@ -1814,7 +1814,7 @@ theorem alive_AndOrXor_2263 (w : Nat) : AndOrXor_2263_src w ⊑ AndOrXor_2263_ %r = or %A, %nb -/ -def AndOrXor_2264_src (w : Nat) := +def alive_AndOrXor_2264_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -1824,7 +1824,7 @@ def AndOrXor_2264_src (w : Nat) := "llvm.return" (%v4) : (_) -> () }] -def AndOrXor_2264_tgt (w : Nat):= +def alive_AndOrXor_2264_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -1835,8 +1835,8 @@ def AndOrXor_2264_tgt (w : Nat):= %v6 = "llvm.or" (%A,%v2) : (_, _) -> (_) "llvm.return" (%v6) : (_) -> () }] -theorem alive_AndOrXor_2264 (w : Nat) : AndOrXor_2264_src w ⊑ AndOrXor_2264_tgt w := by - unfold AndOrXor_2264_src AndOrXor_2264_tgt +theorem alive_AndOrXor_2264 (w : Nat) : alive_AndOrXor_2264_src w ⊑ alive_AndOrXor_2264_tgt w := by + unfold alive_AndOrXor_2264_src alive_AndOrXor_2264_tgt simp_alive_peephole apply bitvec_AndOrXor_2264 @@ -1854,7 +1854,7 @@ theorem alive_AndOrXor_2264 (w : Nat) : AndOrXor_2264_src w ⊑ AndOrXor_2264_ %r = or %A, %B -/ -def AndOrXor_2265_src (w : Nat) := +def alive_AndOrXor_2265_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.and" (%A,%B) : (_, _) -> (_) @@ -1863,7 +1863,7 @@ def AndOrXor_2265_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def AndOrXor_2265_tgt (w : Nat):= +def alive_AndOrXor_2265_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.and" (%A,%B) : (_, _) -> (_) @@ -1871,8 +1871,8 @@ def AndOrXor_2265_tgt (w : Nat):= %v3 = "llvm.or" (%A,%B) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_AndOrXor_2265 (w : Nat) : AndOrXor_2265_src w ⊑ AndOrXor_2265_tgt w := by - unfold AndOrXor_2265_src AndOrXor_2265_tgt +theorem alive_AndOrXor_2265 (w : Nat) : alive_AndOrXor_2265_src w ⊑ alive_AndOrXor_2265_tgt w := by + unfold alive_AndOrXor_2265_src alive_AndOrXor_2265_tgt simp_alive_peephole apply bitvec_AndOrXor_2265 @@ -1891,7 +1891,7 @@ theorem alive_AndOrXor_2265 (w : Nat) : AndOrXor_2265_src w ⊑ AndOrXor_2265_ %r = or %A, %not -/ -def AndOrXor_2284_src (w : Nat) := +def alive_AndOrXor_2284_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.or" (%A,%B) : (_, _) -> (_) @@ -1901,7 +1901,7 @@ def AndOrXor_2284_src (w : Nat) := "llvm.return" (%v4) : (_) -> () }] -def AndOrXor_2284_tgt (w : Nat):= +def alive_AndOrXor_2284_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -1912,8 +1912,8 @@ def AndOrXor_2284_tgt (w : Nat):= %v6 = "llvm.or" (%A,%v2) : (_, _) -> (_) "llvm.return" (%v6) : (_) -> () }] -theorem alive_AndOrXor_2284 (w : Nat) : AndOrXor_2284_src w ⊑ AndOrXor_2284_tgt w := by - unfold AndOrXor_2284_src AndOrXor_2284_tgt +theorem alive_AndOrXor_2284 (w : Nat) : alive_AndOrXor_2284_src w ⊑ alive_AndOrXor_2284_tgt w := by + unfold alive_AndOrXor_2284_src alive_AndOrXor_2284_tgt simp_alive_peephole apply bitvec_AndOrXor_2284 @@ -1932,7 +1932,7 @@ theorem alive_AndOrXor_2284 (w : Nat) : AndOrXor_2284_src w ⊑ AndOrXor_2284_ %r = or %A, %not -/ -def AndOrXor_2285_src (w : Nat) := +def alive_AndOrXor_2285_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.xor" (%A,%B) : (_, _) -> (_) @@ -1942,7 +1942,7 @@ def AndOrXor_2285_src (w : Nat) := "llvm.return" (%v4) : (_) -> () }] -def AndOrXor_2285_tgt (w : Nat):= +def alive_AndOrXor_2285_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -1953,8 +1953,8 @@ def AndOrXor_2285_tgt (w : Nat):= %v6 = "llvm.or" (%A,%v2) : (_, _) -> (_) "llvm.return" (%v6) : (_) -> () }] -theorem alive_AndOrXor_2285 (w : Nat) : AndOrXor_2285_src w ⊑ AndOrXor_2285_tgt w := by - unfold AndOrXor_2285_src AndOrXor_2285_tgt +theorem alive_AndOrXor_2285 (w : Nat) : alive_AndOrXor_2285_src w ⊑ alive_AndOrXor_2285_tgt w := by + unfold alive_AndOrXor_2285_src alive_AndOrXor_2285_tgt simp_alive_peephole apply bitvec_AndOrXor_2285 @@ -1974,7 +1974,7 @@ theorem alive_AndOrXor_2285 (w : Nat) : AndOrXor_2285_src w ⊑ AndOrXor_2285_ %r = xor %na, %B -/ -def AndOrXor_2297_src (w : Nat) := +def alive_AndOrXor_2297_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.and" (%A,%B) : (_, _) -> (_) @@ -1985,7 +1985,7 @@ def AndOrXor_2297_src (w : Nat) := "llvm.return" (%v5) : (_) -> () }] -def AndOrXor_2297_tgt (w : Nat):= +def alive_AndOrXor_2297_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -1995,8 +1995,8 @@ def AndOrXor_2297_tgt (w : Nat):= %v5 = "llvm.xor" (%v2,%B) : (_, _) -> (_) "llvm.return" (%v5) : (_) -> () }] -theorem alive_AndOrXor_2297 (w : Nat) : AndOrXor_2297_src w ⊑ AndOrXor_2297_tgt w := by - unfold AndOrXor_2297_src AndOrXor_2297_tgt +theorem alive_AndOrXor_2297 (w : Nat) : alive_AndOrXor_2297_src w ⊑ alive_AndOrXor_2297_tgt w := by + unfold alive_AndOrXor_2297_src alive_AndOrXor_2297_tgt simp_alive_peephole apply bitvec_AndOrXor_2297 @@ -2013,7 +2013,7 @@ theorem alive_AndOrXor_2297 (w : Nat) : AndOrXor_2297_src w ⊑ AndOrXor_2297_ %r = or %i, C1 -/ -def AndOrXor_2367_src (w : Nat) := +def alive_AndOrXor_2367_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %C1 : _, %op1 : _): %v1 = "llvm.or" (%A,%C1) : (_, _) -> (_) @@ -2021,7 +2021,7 @@ def AndOrXor_2367_src (w : Nat) := "llvm.return" (%v2) : (_) -> () }] -def AndOrXor_2367_tgt (w : Nat):= +def alive_AndOrXor_2367_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %C1 : _, %op1 : _): %v1 = "llvm.or" (%A,%op1) : (_, _) -> (_) @@ -2029,8 +2029,8 @@ def AndOrXor_2367_tgt (w : Nat):= %v3 = "llvm.or" (%v1,%C1) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_AndOrXor_2367 (w : Nat) : AndOrXor_2367_src w ⊑ AndOrXor_2367_tgt w := by - unfold AndOrXor_2367_src AndOrXor_2367_tgt +theorem alive_AndOrXor_2367 (w : Nat) : alive_AndOrXor_2367_src w ⊑ alive_AndOrXor_2367_tgt w := by + unfold alive_AndOrXor_2367_src alive_AndOrXor_2367_tgt simp_alive_peephole apply bitvec_AndOrXor_2367 @@ -2049,7 +2049,7 @@ theorem alive_AndOrXor_2367 (w : Nat) : AndOrXor_2367_src w ⊑ AndOrXor_2367_ %r = or %nx, %ny -/ -def AndOrXor_2416_src (w : Nat) := +def alive_AndOrXor_2416_src (w : Nat) := [mlir_icom (w)| { ^bb0(%nx : _, %y : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -2060,7 +2060,7 @@ def AndOrXor_2416_src (w : Nat) := "llvm.return" (%v5) : (_) -> () }] -def AndOrXor_2416_tgt (w : Nat):= +def alive_AndOrXor_2416_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%nx : _, %y : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -2071,8 +2071,8 @@ def AndOrXor_2416_tgt (w : Nat):= %v6 = "llvm.or" (%nx,%v2) : (_, _) -> (_) "llvm.return" (%v6) : (_) -> () }] -theorem alive_AndOrXor_2416 (w : Nat) : AndOrXor_2416_src w ⊑ AndOrXor_2416_tgt w := by - unfold AndOrXor_2416_src AndOrXor_2416_tgt +theorem alive_AndOrXor_2416 (w : Nat) : alive_AndOrXor_2416_src w ⊑ alive_AndOrXor_2416_tgt w := by + unfold alive_AndOrXor_2416_src alive_AndOrXor_2416_tgt simp_alive_peephole apply bitvec_AndOrXor_2416 @@ -2091,7 +2091,7 @@ theorem alive_AndOrXor_2416 (w : Nat) : AndOrXor_2416_src w ⊑ AndOrXor_2416_ %r = and %nx, %ny -/ -def AndOrXor_2417_src (w : Nat) := +def alive_AndOrXor_2417_src (w : Nat) := [mlir_icom (w)| { ^bb0(%nx : _, %y : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -2102,7 +2102,7 @@ def AndOrXor_2417_src (w : Nat) := "llvm.return" (%v5) : (_) -> () }] -def AndOrXor_2417_tgt (w : Nat):= +def alive_AndOrXor_2417_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%nx : _, %y : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -2113,8 +2113,8 @@ def AndOrXor_2417_tgt (w : Nat):= %v6 = "llvm.and" (%nx,%v2) : (_, _) -> (_) "llvm.return" (%v6) : (_) -> () }] -theorem alive_AndOrXor_2417 (w : Nat) : AndOrXor_2417_src w ⊑ AndOrXor_2417_tgt w := by - unfold AndOrXor_2417_src AndOrXor_2417_tgt +theorem alive_AndOrXor_2417 (w : Nat) : alive_AndOrXor_2417_src w ⊑ alive_AndOrXor_2417_tgt w := by + unfold alive_AndOrXor_2417_src alive_AndOrXor_2417_tgt simp_alive_peephole apply bitvec_AndOrXor_2417 @@ -2132,7 +2132,7 @@ theorem alive_AndOrXor_2417 (w : Nat) : AndOrXor_2417_src w ⊑ AndOrXor_2417_ %r = or %nx, %ny -/ -def AndOrXor_2429_src (w : Nat) := +def alive_AndOrXor_2429_src (w : Nat) := [mlir_icom (w)| { ^bb0(%y : _, %x : _): %v1 = "llvm.and" (%x,%y) : (_, _) -> (_) @@ -2141,7 +2141,7 @@ def AndOrXor_2429_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def AndOrXor_2429_tgt (w : Nat):= +def alive_AndOrXor_2429_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%y : _, %x : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -2152,8 +2152,8 @@ def AndOrXor_2429_tgt (w : Nat):= %v6 = "llvm.or" (%v2,%v4) : (_, _) -> (_) "llvm.return" (%v6) : (_) -> () }] -theorem alive_AndOrXor_2429 (w : Nat) : AndOrXor_2429_src w ⊑ AndOrXor_2429_tgt w := by - unfold AndOrXor_2429_src AndOrXor_2429_tgt +theorem alive_AndOrXor_2429 (w : Nat) : alive_AndOrXor_2429_src w ⊑ alive_AndOrXor_2429_tgt w := by + unfold alive_AndOrXor_2429_src alive_AndOrXor_2429_tgt simp_alive_peephole apply bitvec_AndOrXor_2429 @@ -2171,7 +2171,7 @@ theorem alive_AndOrXor_2429 (w : Nat) : AndOrXor_2429_src w ⊑ AndOrXor_2429_ %r = and %nx, %ny -/ -def AndOrXor_2430_src (w : Nat) := +def alive_AndOrXor_2430_src (w : Nat) := [mlir_icom (w)| { ^bb0(%y : _, %x : _): %v1 = "llvm.or" (%x,%y) : (_, _) -> (_) @@ -2180,7 +2180,7 @@ def AndOrXor_2430_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def AndOrXor_2430_tgt (w : Nat):= +def alive_AndOrXor_2430_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%y : _, %x : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -2191,8 +2191,8 @@ def AndOrXor_2430_tgt (w : Nat):= %v6 = "llvm.and" (%v2,%v4) : (_, _) -> (_) "llvm.return" (%v6) : (_) -> () }] -theorem alive_AndOrXor_2430 (w : Nat) : AndOrXor_2430_src w ⊑ AndOrXor_2430_tgt w := by - unfold AndOrXor_2430_src AndOrXor_2430_tgt +theorem alive_AndOrXor_2430 (w : Nat) : alive_AndOrXor_2430_src w ⊑ alive_AndOrXor_2430_tgt w := by + unfold alive_AndOrXor_2430_src alive_AndOrXor_2430_tgt simp_alive_peephole apply bitvec_AndOrXor_2430 @@ -2210,7 +2210,7 @@ theorem alive_AndOrXor_2430 (w : Nat) : AndOrXor_2430_src w ⊑ AndOrXor_2430_ %r = ashr %x, %y -/ -def AndOrXor_2443_src (w : Nat) := +def alive_AndOrXor_2443_src (w : Nat) := [mlir_icom (w)| { ^bb0(%y : _, %x : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -2221,7 +2221,7 @@ def AndOrXor_2443_src (w : Nat) := "llvm.return" (%v5) : (_) -> () }] -def AndOrXor_2443_tgt (w : Nat):= +def alive_AndOrXor_2443_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%y : _, %x : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -2230,8 +2230,8 @@ def AndOrXor_2443_tgt (w : Nat):= %v4 = "llvm.ashr" (%x,%y) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_AndOrXor_2443 (w : Nat) : AndOrXor_2443_src w ⊑ AndOrXor_2443_tgt w := by - unfold AndOrXor_2443_src AndOrXor_2443_tgt +theorem alive_AndOrXor_2443 (w : Nat) : alive_AndOrXor_2443_src w ⊑ alive_AndOrXor_2443_tgt w := by + unfold alive_AndOrXor_2443_src alive_AndOrXor_2443_tgt simp_alive_peephole apply bitvec_AndOrXor_2443 @@ -2247,7 +2247,7 @@ theorem alive_AndOrXor_2443 (w : Nat) : AndOrXor_2443_src w ⊑ AndOrXor_2443_ %r = icmp sge %x, %y -/ -def AndOrXor_2453_src (w : Nat) := +def alive_AndOrXor_2453_src (w : Nat) := [mlir_icom (w)| { ^bb0(%y : _, %x : _): %v1 = "llvm.icmp slt " (%x,%y) : (_, _) -> (_) @@ -2256,15 +2256,15 @@ def AndOrXor_2453_src (w : Nat) := "llvm.return" (%v3) : (i1) -> () }] -def AndOrXor_2453_tgt (w : Nat):= +def alive_AndOrXor_2453_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%y : _, %x : _): %v1 = "llvm.icmp slt " (%x,%y) : (_, _) -> (_) %v2 = "llvm.icmp sge " (%x,%y) : (_, _) -> (_) "llvm.return" (%v2) : (i1) -> () }] -theorem alive_AndOrXor_2453 : AndOrXor_2453_src ⊑ AndOrXor_2453_tgt := by - unfold AndOrXor_2453_src AndOrXor_2453_tgt +theorem alive_AndOrXor_2453 : alive_AndOrXor_2453_src ⊑ alive_AndOrXor_2453_tgt := by + unfold alive_AndOrXor_2453_src alive_AndOrXor_2453_tgt simp_alive_peephole apply bitvec_AndOrXor_2453 @@ -2280,7 +2280,7 @@ theorem alive_AndOrXor_2453 : AndOrXor_2453_src ⊑ AndOrXor_2453_tgt := by %r = add %x, (-1 - C) -/ -def AndOrXor_2475_src (w : Nat) := +def alive_AndOrXor_2475_src (w : Nat) := [mlir_icom (w)| { ^bb0(%x : _, %C : _): %v1 = "llvm.sub" (%C,%x) : (_, _) -> (_) @@ -2289,7 +2289,7 @@ def AndOrXor_2475_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def AndOrXor_2475_tgt (w : Nat):= +def alive_AndOrXor_2475_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%x : _, %C : _): %v1 = "llvm.sub" (%C,%x) : (_, _) -> (_) @@ -2298,8 +2298,8 @@ def AndOrXor_2475_tgt (w : Nat):= %v4 = "llvm.add" (%x,%v3) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_AndOrXor_2475 (w : Nat) : AndOrXor_2475_src w ⊑ AndOrXor_2475_tgt w := by - unfold AndOrXor_2475_src AndOrXor_2475_tgt +theorem alive_AndOrXor_2475 (w : Nat) : alive_AndOrXor_2475_src w ⊑ alive_AndOrXor_2475_tgt w := by + unfold alive_AndOrXor_2475_src alive_AndOrXor_2475_tgt simp_alive_peephole apply bitvec_AndOrXor_2475 @@ -2315,7 +2315,7 @@ theorem alive_AndOrXor_2475 (w : Nat) : AndOrXor_2475_src w ⊑ AndOrXor_2475_ %r = sub (-1 - C), %x -/ -def AndOrXor_2486_src (w : Nat) := +def alive_AndOrXor_2486_src (w : Nat) := [mlir_icom (w)| { ^bb0(%x : _, %C : _): %v1 = "llvm.add" (%x,%C) : (_, _) -> (_) @@ -2324,7 +2324,7 @@ def AndOrXor_2486_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def AndOrXor_2486_tgt (w : Nat):= +def alive_AndOrXor_2486_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%x : _, %C : _): %v1 = "llvm.add" (%x,%C) : (_, _) -> (_) @@ -2333,8 +2333,8 @@ def AndOrXor_2486_tgt (w : Nat):= %v4 = "llvm.sub" (%v3,%x) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_AndOrXor_2486 (w : Nat) : AndOrXor_2486_src w ⊑ AndOrXor_2486_tgt w := by - unfold AndOrXor_2486_src AndOrXor_2486_tgt +theorem alive_AndOrXor_2486 (w : Nat) : alive_AndOrXor_2486_src w ⊑ alive_AndOrXor_2486_tgt w := by + unfold alive_AndOrXor_2486_src alive_AndOrXor_2486_tgt simp_alive_peephole apply bitvec_AndOrXor_2486 @@ -2351,7 +2351,7 @@ theorem alive_AndOrXor_2486 (w : Nat) : AndOrXor_2486_src w ⊑ AndOrXor_2486_ %r = and %a, %nop1 -/ -def AndOrXor_2581__BAB___A__B_src (w : Nat) := +def alive_AndOrXor_2581__BAB___A__B_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %op1 : _): %v1 = "llvm.or" (%a,%op1) : (_, _) -> (_) @@ -2359,7 +2359,7 @@ def AndOrXor_2581__BAB___A__B_src (w : Nat) := "llvm.return" (%v2) : (_) -> () }] -def AndOrXor_2581__BAB___A__B_tgt (w : Nat):= +def alive_AndOrXor_2581__BAB___A__B_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _, %op1 : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -2368,8 +2368,8 @@ def AndOrXor_2581__BAB___A__B_tgt (w : Nat):= %v4 = "llvm.and" (%a,%v2) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_AndOrXor_2581__BAB___A__B (w : Nat) : AndOrXor_2581__BAB___A__B_src w ⊑ AndOrXor_2581__BAB___A__B_tgt w := by - unfold AndOrXor_2581__BAB___A__B_src AndOrXor_2581__BAB___A__B_tgt +theorem alive_AndOrXor_2581__BAB___A__B (w : Nat) : alive_AndOrXor_2581__BAB___A__B_src w ⊑ alive_AndOrXor_2581__BAB___A__B_tgt w := by + unfold alive_AndOrXor_2581__BAB___A__B_src alive_AndOrXor_2581__BAB___A__B_tgt simp_alive_peephole apply bitvec_AndOrXor_2581__BAB___A__B @@ -2386,7 +2386,7 @@ theorem alive_AndOrXor_2581__BAB___A__B (w : Nat) : AndOrXor_2581__BAB___A__B_s %r = and %na, %op1 -/ -def AndOrXor_2587__BAA___B__A_src (w : Nat) := +def alive_AndOrXor_2587__BAA___B__A_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %op1 : _): %v1 = "llvm.and" (%a,%op1) : (_, _) -> (_) @@ -2394,7 +2394,7 @@ def AndOrXor_2587__BAA___B__A_src (w : Nat) := "llvm.return" (%v2) : (_) -> () }] -def AndOrXor_2587__BAA___B__A_tgt (w : Nat):= +def alive_AndOrXor_2587__BAA___B__A_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _, %op1 : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -2403,8 +2403,8 @@ def AndOrXor_2587__BAA___B__A_tgt (w : Nat):= %v4 = "llvm.and" (%v2,%op1) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_AndOrXor_2587__BAA___B__A (w : Nat) : AndOrXor_2587__BAA___B__A_src w ⊑ AndOrXor_2587__BAA___B__A_tgt w := by - unfold AndOrXor_2587__BAA___B__A_src AndOrXor_2587__BAA___B__A_tgt +theorem alive_AndOrXor_2587__BAA___B__A (w : Nat) : alive_AndOrXor_2587__BAA___B__A_src w ⊑ alive_AndOrXor_2587__BAA___B__A_tgt w := by + unfold alive_AndOrXor_2587__BAA___B__A_src alive_AndOrXor_2587__BAA___B__A_tgt simp_alive_peephole apply bitvec_AndOrXor_2587__BAA___B__A @@ -2422,7 +2422,7 @@ theorem alive_AndOrXor_2587__BAA___B__A (w : Nat) : AndOrXor_2587__BAA___B__A_s %r = xor %a, %b -/ -def AndOrXor_2595_src (w : Nat) := +def alive_AndOrXor_2595_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) @@ -2431,7 +2431,7 @@ def AndOrXor_2595_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def AndOrXor_2595_tgt (w : Nat):= +def alive_AndOrXor_2595_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) @@ -2439,8 +2439,8 @@ def AndOrXor_2595_tgt (w : Nat):= %v3 = "llvm.xor" (%a,%b) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_AndOrXor_2595 (w : Nat) : AndOrXor_2595_src w ⊑ AndOrXor_2595_tgt w := by - unfold AndOrXor_2595_src AndOrXor_2595_tgt +theorem alive_AndOrXor_2595 (w : Nat) : alive_AndOrXor_2595_src w ⊑ alive_AndOrXor_2595_tgt w := by + unfold alive_AndOrXor_2595_src alive_AndOrXor_2595_tgt simp_alive_peephole apply bitvec_AndOrXor_2595 @@ -2462,7 +2462,7 @@ theorem alive_AndOrXor_2595 (w : Nat) : AndOrXor_2595_src w ⊑ AndOrXor_2595_ %r = xor %a, %b -/ -def AndOrXor_2607_src (w : Nat) := +def alive_AndOrXor_2607_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -2475,7 +2475,7 @@ def AndOrXor_2607_src (w : Nat) := "llvm.return" (%v7) : (_) -> () }] -def AndOrXor_2607_tgt (w : Nat):= +def alive_AndOrXor_2607_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -2487,8 +2487,8 @@ def AndOrXor_2607_tgt (w : Nat):= %v7 = "llvm.xor" (%a,%b) : (_, _) -> (_) "llvm.return" (%v7) : (_) -> () }] -theorem alive_AndOrXor_2607 (w : Nat) : AndOrXor_2607_src w ⊑ AndOrXor_2607_tgt w := by - unfold AndOrXor_2607_src AndOrXor_2607_tgt +theorem alive_AndOrXor_2607 (w : Nat) : alive_AndOrXor_2607_src w ⊑ alive_AndOrXor_2607_tgt w := by + unfold alive_AndOrXor_2607_src alive_AndOrXor_2607_tgt simp_alive_peephole apply bitvec_AndOrXor_2607 @@ -2510,7 +2510,7 @@ theorem alive_AndOrXor_2607 (w : Nat) : AndOrXor_2607_src w ⊑ AndOrXor_2607_ %r = xor %a, %b -/ -def AndOrXor_2617_src (w : Nat) := +def alive_AndOrXor_2617_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -2523,7 +2523,7 @@ def AndOrXor_2617_src (w : Nat) := "llvm.return" (%v7) : (_) -> () }] -def AndOrXor_2617_tgt (w : Nat):= +def alive_AndOrXor_2617_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -2535,8 +2535,8 @@ def AndOrXor_2617_tgt (w : Nat):= %v7 = "llvm.xor" (%a,%b) : (_, _) -> (_) "llvm.return" (%v7) : (_) -> () }] -theorem alive_AndOrXor_2617 (w : Nat) : AndOrXor_2617_src w ⊑ AndOrXor_2617_tgt w := by - unfold AndOrXor_2617_src AndOrXor_2617_tgt +theorem alive_AndOrXor_2617 (w : Nat) : alive_AndOrXor_2617_src w ⊑ alive_AndOrXor_2617_tgt w := by + unfold alive_AndOrXor_2617_src alive_AndOrXor_2617_tgt simp_alive_peephole apply bitvec_AndOrXor_2617 @@ -2556,7 +2556,7 @@ theorem alive_AndOrXor_2617 (w : Nat) : AndOrXor_2617_src w ⊑ AndOrXor_2617_ %r = xor %and, %c -/ -def AndOrXor_2627_src (w : Nat) := +def alive_AndOrXor_2627_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %c : _, %b : _): %v1 = "llvm.xor" (%a,%c) : (_, _) -> (_) @@ -2565,7 +2565,7 @@ def AndOrXor_2627_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def AndOrXor_2627_tgt (w : Nat):= +def alive_AndOrXor_2627_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _, %c : _, %b : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -2576,8 +2576,8 @@ def AndOrXor_2627_tgt (w : Nat):= %v6 = "llvm.xor" (%v3,%c) : (_, _) -> (_) "llvm.return" (%v6) : (_) -> () }] -theorem alive_AndOrXor_2627 (w : Nat) : AndOrXor_2627_src w ⊑ AndOrXor_2627_tgt w := by - unfold AndOrXor_2627_src AndOrXor_2627_tgt +theorem alive_AndOrXor_2627 (w : Nat) : alive_AndOrXor_2627_src w ⊑ alive_AndOrXor_2627_tgt w := by + unfold alive_AndOrXor_2627_src alive_AndOrXor_2627_tgt simp_alive_peephole apply bitvec_AndOrXor_2627 @@ -2595,7 +2595,7 @@ theorem alive_AndOrXor_2627 (w : Nat) : AndOrXor_2627_src w ⊑ AndOrXor_2627_ %r = or %a, %b -/ -def AndOrXor_2647_src (w : Nat) := +def alive_AndOrXor_2647_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) @@ -2604,7 +2604,7 @@ def AndOrXor_2647_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def AndOrXor_2647_tgt (w : Nat):= +def alive_AndOrXor_2647_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) @@ -2612,8 +2612,8 @@ def AndOrXor_2647_tgt (w : Nat):= %v3 = "llvm.or" (%a,%b) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_AndOrXor_2647 (w : Nat) : AndOrXor_2647_src w ⊑ AndOrXor_2647_tgt w := by - unfold AndOrXor_2647_src AndOrXor_2647_tgt +theorem alive_AndOrXor_2647 (w : Nat) : alive_AndOrXor_2647_src w ⊑ alive_AndOrXor_2647_tgt w := by + unfold alive_AndOrXor_2647_src alive_AndOrXor_2647_tgt simp_alive_peephole apply bitvec_AndOrXor_2647 @@ -2634,7 +2634,7 @@ theorem alive_AndOrXor_2647 (w : Nat) : AndOrXor_2647_src w ⊑ AndOrXor_2647_ %r = xor %and, -1 -/ -def AndOrXor_2658_src (w : Nat) := +def alive_AndOrXor_2658_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -2646,7 +2646,7 @@ def AndOrXor_2658_src (w : Nat) := "llvm.return" (%v6) : (_) -> () }] -def AndOrXor_2658_tgt (w : Nat):= +def alive_AndOrXor_2658_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) @@ -2659,8 +2659,8 @@ def AndOrXor_2658_tgt (w : Nat):= %v8 = "llvm.xor" (%v1,%v7) : (_, _) -> (_) "llvm.return" (%v8) : (_) -> () }] -theorem alive_AndOrXor_2658 (w : Nat) : AndOrXor_2658_src w ⊑ AndOrXor_2658_tgt w := by - unfold AndOrXor_2658_src AndOrXor_2658_tgt +theorem alive_AndOrXor_2658 (w : Nat) : alive_AndOrXor_2658_src w ⊑ alive_AndOrXor_2658_tgt w := by + unfold alive_AndOrXor_2658_src alive_AndOrXor_2658_tgt simp_alive_peephole apply bitvec_AndOrXor_2658 @@ -2678,7 +2678,7 @@ theorem alive_AndOrXor_2658 (w : Nat) : AndOrXor_2658_src w ⊑ AndOrXor_2658_ %r = icmp uge %a, %b -/ -def AndOrXor_2663_src (w : Nat) := +def alive_AndOrXor_2663_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.icmp ule " (%a,%b) : (_, _) -> (_) @@ -2687,7 +2687,7 @@ def AndOrXor_2663_src (w : Nat) := "llvm.return" (%v3) : (i1) -> () }] -def AndOrXor_2663_tgt (w : Nat):= +def alive_AndOrXor_2663_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.icmp ule " (%a,%b) : (_, _) -> (_) @@ -2695,8 +2695,8 @@ def AndOrXor_2663_tgt (w : Nat):= %v3 = "llvm.icmp uge " (%a,%b) : (_, _) -> (_) "llvm.return" (%v3) : (i1) -> () }] -theorem alive_AndOrXor_2663 : AndOrXor_2663_src ⊑ AndOrXor_2663_tgt := by - unfold AndOrXor_2663_src AndOrXor_2663_tgt +theorem alive_AndOrXor_2663 : alive_AndOrXor_2663_src ⊑ alive_AndOrXor_2663_tgt := by + unfold alive_AndOrXor_2663_src alive_AndOrXor_2663_tgt simp_alive_peephole apply bitvec_AndOrXor_2663 @@ -2710,7 +2710,7 @@ theorem alive_AndOrXor_2663 : AndOrXor_2663_src ⊑ AndOrXor_2663_tgt := by %r = sub 0, %x -/ -def 152_src (w : Nat) := +def alive_152_src (w : Nat) := [mlir_icom (w)| { ^bb0(%x : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -2718,15 +2718,15 @@ def 152_src (w : Nat) := "llvm.return" (%v2) : (_) -> () }] -def 152_tgt (w : Nat):= +def alive_152_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%x : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v2 = "llvm.sub" (%v1,%x) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -theorem alive_152 (w : Nat) : 152_src w ⊑ 152_tgt w := by - unfold 152_src 152_tgt +theorem alive_152 (w : Nat) : alive_152_src w ⊑ alive_152_tgt w := by + unfold alive_152_src alive_152_tgt simp_alive_peephole apply bitvec_152 @@ -2744,7 +2744,7 @@ theorem alive_152 (w : Nat) : 152_src w ⊑ 152_tgt w := by %r = add %tmp, %mul -/ -def 229_src (w : Nat) := +def alive_229_src (w : Nat) := [mlir_icom (w)| { ^bb0(%X : _, %C1 : _, %Op1 : _): %v1 = "llvm.add" (%X,%C1) : (_, _) -> (_) @@ -2752,7 +2752,7 @@ def 229_src (w : Nat) := "llvm.return" (%v2) : (_) -> () }] -def 229_tgt (w : Nat):= +def alive_229_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%X : _, %C1 : _, %Op1 : _): %v1 = "llvm.mul" (%C1,%Op1) : (_, _) -> (_) @@ -2761,8 +2761,8 @@ def 229_tgt (w : Nat):= %v4 = "llvm.add" (%v2,%v1) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_229 (w : Nat) : 229_src w ⊑ 229_tgt w := by - unfold 229_src 229_tgt +theorem alive_229 (w : Nat) : alive_229_src w ⊑ alive_229_tgt w := by + unfold alive_229_src alive_229_tgt simp_alive_peephole apply bitvec_229 @@ -2780,7 +2780,7 @@ theorem alive_229 (w : Nat) : 229_src w ⊑ 229_tgt w := by %r = mul %X, %Y -/ -def 239_src (w : Nat) := +def alive_239_src (w : Nat) := [mlir_icom (w)| { ^bb0(%Y : _, %X : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) @@ -2791,7 +2791,7 @@ def 239_src (w : Nat) := "llvm.return" (%v5) : (_) -> () }] -def 239_tgt (w : Nat):= +def alive_239_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%Y : _, %X : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) @@ -2801,8 +2801,8 @@ def 239_tgt (w : Nat):= %v5 = "llvm.mul" (%X,%Y) : (_, _) -> (_) "llvm.return" (%v5) : (_) -> () }] -theorem alive_239 (w : Nat) : 239_src w ⊑ 239_tgt w := by - unfold 239_src 239_tgt +theorem alive_239 (w : Nat) : alive_239_src w ⊑ alive_239_tgt w := by + unfold alive_239_src alive_239_tgt simp_alive_peephole apply bitvec_239 @@ -2819,7 +2819,7 @@ theorem alive_239 (w : Nat) : 239_src w ⊑ 239_tgt w := by %r = sub %X, %rem -/ -def 275_src := +def alive_275_src := [mlir_icom ()| { ^bb0(%Y : i5, %X : i5): %v1 = "llvm.udiv" (%X,%Y) : (i5, i5) -> (i5) @@ -2827,7 +2827,7 @@ def 275_src := "llvm.return" (%v2) : (i5) -> () }] -def 275_tgt := +def alive_275_tgt := [mlir_icom ()| { ^bb0(%Y : i5, %X : i5): %v1 = "llvm.urem" (%X,%Y) : (i5, i5) -> (i5) @@ -2835,8 +2835,8 @@ def 275_tgt := %v3 = "llvm.sub" (%X,%v1) : (i5, i5) -> (i5) "llvm.return" (%v3) : (i5) -> () }] -theorem alive_275 : 275_src ⊑ 275_tgt := by - unfold 275_src 275_tgt +theorem alive_275 : alive_275_src ⊑ alive_275_tgt := by + unfold alive_275_src alive_275_tgt simp_alive_peephole apply bitvec_275 @@ -2853,7 +2853,7 @@ theorem alive_275 : 275_src ⊑ 275_tgt := by %r = sub %X, %rem -/ -def 275_2_src := +def alive_275_2_src := [mlir_icom ()| { ^bb0(%Y : i5, %X : i5): %v1 = "llvm.sdiv" (%X,%Y) : (i5, i5) -> (i5) @@ -2861,7 +2861,7 @@ def 275_2_src := "llvm.return" (%v2) : (i5) -> () }] -def 275_2_tgt := +def alive_275_2_tgt := [mlir_icom ()| { ^bb0(%Y : i5, %X : i5): %v1 = "llvm.srem" (%X,%Y) : (i5, i5) -> (i5) @@ -2869,8 +2869,8 @@ def 275_2_tgt := %v3 = "llvm.sub" (%X,%v1) : (i5, i5) -> (i5) "llvm.return" (%v3) : (i5) -> () }] -theorem alive_275_2 : 275_2_src ⊑ 275_2_tgt := by - unfold 275_2_src 275_2_tgt +theorem alive_275_2 : alive_275_2_src ⊑ alive_275_2_tgt := by + unfold alive_275_2_src alive_275_2_tgt simp_alive_peephole apply bitvec_275_2 @@ -2889,7 +2889,7 @@ theorem alive_275_2 : 275_2_src ⊑ 275_2_tgt := by %r = sub %rem, %X -/ -def 276_src := +def alive_276_src := [mlir_icom ()| { ^bb0(%Y : i5, %X : i5): %v1 = "llvm.sdiv" (%X,%Y) : (i5, i5) -> (i5) @@ -2899,7 +2899,7 @@ def 276_src := "llvm.return" (%v4) : (i5) -> () }] -def 276_tgt := +def alive_276_tgt := [mlir_icom ()| { ^bb0(%Y : i5, %X : i5): %v1 = "llvm.srem" (%X,%Y) : (i5, i5) -> (i5) @@ -2909,8 +2909,8 @@ def 276_tgt := %v5 = "llvm.sub" (%v1,%X) : (i5, i5) -> (i5) "llvm.return" (%v5) : (i5) -> () }] -theorem alive_276 : 276_src ⊑ 276_tgt := by - unfold 276_src 276_tgt +theorem alive_276 : alive_276_src ⊑ alive_276_tgt := by + unfold alive_276_src alive_276_tgt simp_alive_peephole apply bitvec_276 @@ -2929,7 +2929,7 @@ theorem alive_276 : 276_src ⊑ 276_tgt := by %r = sub %rem, %X -/ -def 276_2_src := +def alive_276_2_src := [mlir_icom ()| { ^bb0(%Y : i5, %X : i5): %v1 = "llvm.udiv" (%X,%Y) : (i5, i5) -> (i5) @@ -2939,7 +2939,7 @@ def 276_2_src := "llvm.return" (%v4) : (i5) -> () }] -def 276_2_tgt := +def alive_276_2_tgt := [mlir_icom ()| { ^bb0(%Y : i5, %X : i5): %v1 = "llvm.urem" (%X,%Y) : (i5, i5) -> (i5) @@ -2949,8 +2949,8 @@ def 276_2_tgt := %v5 = "llvm.sub" (%v1,%X) : (i5, i5) -> (i5) "llvm.return" (%v5) : (i5) -> () }] -theorem alive_276_2 : 276_2_src ⊑ 276_2_tgt := by - unfold 276_2_src 276_2_tgt +theorem alive_276_2 : alive_276_2_src ⊑ alive_276_2_tgt := by + unfold alive_276_2_src alive_276_2_tgt simp_alive_peephole apply bitvec_276_2 @@ -2964,21 +2964,21 @@ theorem alive_276_2 : 276_2_src ⊑ 276_2_tgt := by %r = and %X, %Y -/ -def 283_src := +def alive_283_src := [mlir_icom ()| { ^bb0(%Y : i1, %X : i1): %v1 = "llvm.mul" (%X,%Y) : (i1, i1) -> (i1) "llvm.return" (%v1) : (i1) -> () }] -def 283_tgt := +def alive_283_tgt := [mlir_icom ()| { ^bb0(%Y : i1, %X : i1): %v1 = "llvm.and" (%X,%Y) : (i1, i1) -> (i1) "llvm.return" (%v1) : (i1) -> () }] -theorem alive_283 : 283_src ⊑ 283_tgt := by - unfold 283_src 283_tgt +theorem alive_283 : alive_283_src ⊑ alive_283_tgt := by + unfold alive_283_src alive_283_tgt simp_alive_peephole apply bitvec_283 @@ -2994,7 +2994,7 @@ theorem alive_283 : 283_src ⊑ 283_tgt := by %r = shl %Op1, %Y -/ -def 290__292_src (w : Nat) := +def alive_290__292_src (w : Nat) := [mlir_icom (w)| { ^bb0(%Y : _, %Op1 : _): %v1 = "llvm.mlir.constant" () { value = 1 : _ } :() -> (_) @@ -3003,7 +3003,7 @@ def 290__292_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def 290__292_tgt (w : Nat):= +def alive_290__292_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%Y : _, %Op1 : _): %v1 = "llvm.mlir.constant" () { value = 1 : _ } :() -> (_) @@ -3011,8 +3011,8 @@ def 290__292_tgt (w : Nat):= %v3 = "llvm.shl" (%Op1,%Y) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_290__292 (w : Nat) : 290__292_src w ⊑ 290__292_tgt w := by - unfold 290__292_src 290__292_tgt +theorem alive_290__292 (w : Nat) : alive_290__292_src w ⊑ alive_290__292_tgt w := by + unfold alive_290__292_src alive_290__292_tgt simp_alive_peephole apply bitvec_290__292 @@ -3028,7 +3028,7 @@ theorem alive_290__292 (w : Nat) : 290__292_src w ⊑ 290__292_tgt w := by %r = select i1 %c, %X, 0 -/ -def 805_src (w : Nat) := +def alive_805_src (w : Nat) := [mlir_icom (w)| { ^bb0(%X : _): %v1 = "llvm.mlir.constant" () { value = 1 : _ } :() -> (_) @@ -3036,7 +3036,7 @@ def 805_src (w : Nat) := "llvm.return" (%v2) : (_) -> () }] -def 805_tgt (w : Nat):= +def alive_805_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%X : _): %v1 = "llvm.mlir.constant" () { value = 1 : _ } :() -> (_) @@ -3047,8 +3047,8 @@ def 805_tgt (w : Nat):= %v6 = "llvm.select" (%v4,%X,%v5) : (_, _, _) -> (_) "llvm.return" (%v6) : (_) -> () }] -theorem alive_805 (w : Nat) : 805_src w ⊑ 805_tgt w := by - unfold 805_src 805_tgt +theorem alive_805 (w : Nat) : alive_805_src w ⊑ alive_805_tgt w := by + unfold alive_805_src alive_805_tgt simp_alive_peephole apply bitvec_805 @@ -3066,7 +3066,7 @@ theorem alive_805 (w : Nat) : 805_src w ⊑ 805_tgt w := by %r = sdiv %X, %Op1 -/ -def 820_src := +def alive_820_src := [mlir_icom ()| { ^bb0(%X : i9, %Op1 : i9): %v1 = "llvm.srem" (%X,%Op1) : (i9, i9) -> (i9) @@ -3075,7 +3075,7 @@ def 820_src := "llvm.return" (%v3) : (i9) -> () }] -def 820_tgt := +def alive_820_tgt := [mlir_icom ()| { ^bb0(%X : i9, %Op1 : i9): %v1 = "llvm.srem" (%X,%Op1) : (i9, i9) -> (i9) @@ -3083,8 +3083,8 @@ def 820_tgt := %v3 = "llvm.sdiv" (%X,%Op1) : (i9, i9) -> (i9) "llvm.return" (%v3) : (i9) -> () }] -theorem alive_820 : 820_src ⊑ 820_tgt := by - unfold 820_src 820_tgt +theorem alive_820 : alive_820_src ⊑ alive_820_tgt := by + unfold alive_820_src alive_820_tgt simp_alive_peephole apply bitvec_820 @@ -3102,7 +3102,7 @@ theorem alive_820 : 820_src ⊑ 820_tgt := by %r = udiv %X, %Op1 -/ -def 820'_src := +def alive_820'_src := [mlir_icom ()| { ^bb0(%X : i9, %Op1 : i9): %v1 = "llvm.urem" (%X,%Op1) : (i9, i9) -> (i9) @@ -3111,7 +3111,7 @@ def 820'_src := "llvm.return" (%v3) : (i9) -> () }] -def 820'_tgt := +def alive_820'_tgt := [mlir_icom ()| { ^bb0(%X : i9, %Op1 : i9): %v1 = "llvm.urem" (%X,%Op1) : (i9, i9) -> (i9) @@ -3119,8 +3119,8 @@ def 820'_tgt := %v3 = "llvm.udiv" (%X,%Op1) : (i9, i9) -> (i9) "llvm.return" (%v3) : (i9) -> () }] -theorem alive_820' : 820'_src ⊑ 820'_tgt := by - unfold 820'_src 820'_tgt +theorem alive_820' : alive_820'_src ⊑ alive_820'_tgt := by + unfold alive_820'_src alive_820'_tgt simp_alive_peephole apply bitvec_820' @@ -3134,7 +3134,7 @@ theorem alive_820' : 820'_src ⊑ 820'_tgt := by %r = sub 0, %X -/ -def 1030_src (w : Nat) := +def alive_1030_src (w : Nat) := [mlir_icom (w)| { ^bb0(%X : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -3142,15 +3142,15 @@ def 1030_src (w : Nat) := "llvm.return" (%v2) : (_) -> () }] -def 1030_tgt (w : Nat):= +def alive_1030_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%X : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v2 = "llvm.sub" (%v1,%X) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -theorem alive_1030 (w : Nat) : 1030_src w ⊑ 1030_tgt w := by - unfold 1030_src 1030_tgt +theorem alive_1030 (w : Nat) : alive_1030_src w ⊑ alive_1030_tgt w := by + unfold alive_1030_src alive_1030_tgt simp_alive_peephole apply bitvec_1030 @@ -3166,7 +3166,7 @@ theorem alive_1030 (w : Nat) : 1030_src w ⊑ 1030_tgt w := by %r = select i1 %c, C, %Y -/ -def Select_637_src (w : Nat) := +def alive_Select_637_src (w : Nat) := [mlir_icom (w)| { ^bb0(%Y : _, %X : _, %C : _): %v1 = "llvm.icmp eq " (%X,%C) : (_, _) -> (_) @@ -3174,15 +3174,15 @@ def Select_637_src (w : Nat) := "llvm.return" (%v2) : (_) -> () }] -def Select_637_tgt (w : Nat):= +def alive_Select_637_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%Y : _, %X : _, %C : _): %v1 = "llvm.icmp eq " (%X,%C) : (_, _) -> (_) %v2 = "llvm.select" (%v1,%C,%Y) : (_, _, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -theorem alive_Select_637 (w : Nat) : Select_637_src w ⊑ Select_637_tgt w := by - unfold Select_637_src Select_637_tgt +theorem alive_Select_637 (w : Nat) : alive_Select_637_src w ⊑ alive_Select_637_tgt w := by + unfold alive_Select_637_src alive_Select_637_tgt simp_alive_peephole apply bitvec_Select_637 @@ -3198,7 +3198,7 @@ theorem alive_Select_637 (w : Nat) : Select_637_src w ⊑ Select_637_tgt w := %r = select i1 %c, %Y, C -/ -def Select_641_src (w : Nat) := +def alive_Select_641_src (w : Nat) := [mlir_icom (w)| { ^bb0(%Y : _, %X : _, %C : _): %v1 = "llvm.icmp ne " (%X,%C) : (_, _) -> (_) @@ -3206,15 +3206,15 @@ def Select_641_src (w : Nat) := "llvm.return" (%v2) : (_) -> () }] -def Select_641_tgt (w : Nat):= +def alive_Select_641_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%Y : _, %X : _, %C : _): %v1 = "llvm.icmp ne " (%X,%C) : (_, _) -> (_) %v2 = "llvm.select" (%v1,%Y,%C) : (_, _, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -theorem alive_Select_641 (w : Nat) : Select_641_src w ⊑ Select_641_tgt w := by - unfold Select_641_src Select_641_tgt +theorem alive_Select_641 (w : Nat) : alive_Select_641_src w ⊑ alive_Select_641_tgt w := by + unfold alive_Select_641_src alive_Select_641_tgt simp_alive_peephole apply bitvec_Select_641 @@ -3234,7 +3234,7 @@ theorem alive_Select_641 (w : Nat) : Select_641_src w ⊑ Select_641_tgt w := %umax2 = select i1 %c, %A, %B -/ -def Select_699_src (w : Nat) := +def alive_Select_699_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.icmp uge " (%A,%B) : (_, _) -> (_) @@ -3244,7 +3244,7 @@ def Select_699_src (w : Nat) := "llvm.return" (%v4) : (_) -> () }] -def Select_699_tgt (w : Nat):= +def alive_Select_699_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.icmp uge " (%A,%B) : (_, _) -> (_) @@ -3253,8 +3253,8 @@ def Select_699_tgt (w : Nat):= %v4 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_Select_699 (w : Nat) : Select_699_src w ⊑ Select_699_tgt w := by - unfold Select_699_src Select_699_tgt +theorem alive_Select_699 (w : Nat) : alive_Select_699_src w ⊑ alive_Select_699_tgt w := by + unfold alive_Select_699_src alive_Select_699_tgt simp_alive_peephole apply bitvec_Select_699 @@ -3274,7 +3274,7 @@ theorem alive_Select_699 (w : Nat) : Select_699_src w ⊑ Select_699_tgt w := %smin2 = select i1 %c, %A, %B -/ -def Select_700_src (w : Nat) := +def alive_Select_700_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.icmp slt " (%A,%B) : (_, _) -> (_) @@ -3284,7 +3284,7 @@ def Select_700_src (w : Nat) := "llvm.return" (%v4) : (_) -> () }] -def Select_700_tgt (w : Nat):= +def alive_Select_700_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.icmp slt " (%A,%B) : (_, _) -> (_) @@ -3293,8 +3293,8 @@ def Select_700_tgt (w : Nat):= %v4 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_Select_700 (w : Nat) : Select_700_src w ⊑ Select_700_tgt w := by - unfold Select_700_src Select_700_tgt +theorem alive_Select_700 (w : Nat) : alive_Select_700_src w ⊑ alive_Select_700_tgt w := by + unfold alive_Select_700_src alive_Select_700_tgt simp_alive_peephole apply bitvec_Select_700 @@ -3314,7 +3314,7 @@ theorem alive_Select_700 (w : Nat) : Select_700_src w ⊑ Select_700_tgt w := %smax = %A -/ -def Select_704_src (w : Nat) := +def alive_Select_704_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.icmp slt " (%A,%B) : (_, _) -> (_) @@ -3324,7 +3324,7 @@ def Select_704_src (w : Nat) := "llvm.return" (%v4) : (_) -> () }] -def Select_704_tgt (w : Nat):= +def alive_Select_704_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.icmp slt " (%A,%B) : (_, _) -> (_) @@ -3333,8 +3333,8 @@ def Select_704_tgt (w : Nat):= %v4 = "llvm.copy" (%A) : (_) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_Select_704 (w : Nat) : Select_704_src w ⊑ Select_704_tgt w := by - unfold Select_704_src Select_704_tgt +theorem alive_Select_704 (w : Nat) : alive_Select_704_src w ⊑ alive_Select_704_tgt w := by + unfold alive_Select_704_src alive_Select_704_tgt simp_alive_peephole apply bitvec_Select_704 @@ -3354,7 +3354,7 @@ theorem alive_Select_704 (w : Nat) : Select_704_src w ⊑ Select_704_tgt w := %umin = %A -/ -def Select_705_src (w : Nat) := +def alive_Select_705_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.icmp sge " (%A,%B) : (_, _) -> (_) @@ -3364,7 +3364,7 @@ def Select_705_src (w : Nat) := "llvm.return" (%v4) : (_) -> () }] -def Select_705_tgt (w : Nat):= +def alive_Select_705_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.icmp sge " (%A,%B) : (_, _) -> (_) @@ -3373,8 +3373,8 @@ def Select_705_tgt (w : Nat):= %v4 = "llvm.copy" (%A) : (_) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_Select_705 (w : Nat) : Select_705_src w ⊑ Select_705_tgt w := by - unfold Select_705_src Select_705_tgt +theorem alive_Select_705 (w : Nat) : alive_Select_705_src w ⊑ alive_Select_705_tgt w := by + unfold alive_Select_705_src alive_Select_705_tgt simp_alive_peephole apply bitvec_Select_705 @@ -3398,7 +3398,7 @@ theorem alive_Select_705 (w : Nat) : Select_705_src w ⊑ Select_705_tgt w := %abs2 = select i1 %c, %A, %minus -/ -def Select_740_src (w : Nat) := +def alive_Select_740_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) @@ -3414,7 +3414,7 @@ def Select_740_src (w : Nat) := "llvm.return" (%v10) : (_) -> () }] -def Select_740_tgt (w : Nat):= +def alive_Select_740_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) @@ -3429,8 +3429,8 @@ def Select_740_tgt (w : Nat):= %v10 = "llvm.select" (%v2,%A,%v4) : (_, _, _) -> (_) "llvm.return" (%v10) : (_) -> () }] -theorem alive_Select_740 (w : Nat) : Select_740_src w ⊑ Select_740_tgt w := by - unfold Select_740_src Select_740_tgt +theorem alive_Select_740 (w : Nat) : alive_Select_740_src w ⊑ alive_Select_740_tgt w := by + unfold alive_Select_740_src alive_Select_740_tgt simp_alive_peephole apply bitvec_Select_740 @@ -3454,7 +3454,7 @@ theorem alive_Select_740 (w : Nat) : Select_740_src w ⊑ Select_740_tgt w := %abs2 = select i1 %c, %minus, %A -/ -def Select_741_src (w : Nat) := +def alive_Select_741_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) @@ -3470,7 +3470,7 @@ def Select_741_src (w : Nat) := "llvm.return" (%v10) : (_) -> () }] -def Select_741_tgt (w : Nat):= +def alive_Select_741_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) @@ -3485,8 +3485,8 @@ def Select_741_tgt (w : Nat):= %v10 = "llvm.select" (%v2,%v4,%A) : (_, _, _) -> (i1) "llvm.return" (%v10) : (i1) -> () }] -theorem alive_Select_741 : Select_741_src ⊑ Select_741_tgt := by - unfold Select_741_src Select_741_tgt +theorem alive_Select_741 : alive_Select_741_src ⊑ alive_Select_741_tgt := by + unfold alive_Select_741_src alive_Select_741_tgt simp_alive_peephole apply bitvec_Select_741 @@ -3511,7 +3511,7 @@ theorem alive_Select_741 : Select_741_src ⊑ Select_741_tgt := by %abs2 = select i1 %c3, %A, %minus -/ -def Select_746_src (w : Nat) := +def alive_Select_746_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) @@ -3527,7 +3527,7 @@ def Select_746_src (w : Nat) := "llvm.return" (%v10) : (_) -> () }] -def Select_746_tgt (w : Nat):= +def alive_Select_746_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) @@ -3544,8 +3544,8 @@ def Select_746_tgt (w : Nat):= %v12 = "llvm.select" (%v4,%A,%v2) : (_, _, _) -> (_) "llvm.return" (%v12) : (_) -> () }] -theorem alive_Select_746 (w : Nat) : Select_746_src w ⊑ Select_746_tgt w := by - unfold Select_746_src Select_746_tgt +theorem alive_Select_746 (w : Nat) : alive_Select_746_src w ⊑ alive_Select_746_tgt w := by + unfold alive_Select_746_src alive_Select_746_tgt simp_alive_peephole apply bitvec_Select_746 @@ -3570,7 +3570,7 @@ theorem alive_Select_746 (w : Nat) : Select_746_src w ⊑ Select_746_tgt w := %abs2 = select i1 %c3, %A, %minus -/ -def Select_747_src (w : Nat) := +def alive_Select_747_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) @@ -3586,7 +3586,7 @@ def Select_747_src (w : Nat) := "llvm.return" (%v10) : (_) -> () }] -def Select_747_tgt (w : Nat):= +def alive_Select_747_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) @@ -3603,8 +3603,8 @@ def Select_747_tgt (w : Nat):= %v12 = "llvm.select" (%v4,%A,%v2) : (_, _, _) -> (_) "llvm.return" (%v12) : (_) -> () }] -theorem alive_Select_747 (w : Nat) : Select_747_src w ⊑ Select_747_tgt w := by - unfold Select_747_src Select_747_tgt +theorem alive_Select_747 (w : Nat) : alive_Select_747_src w ⊑ alive_Select_747_tgt w := by + unfold alive_Select_747_src alive_Select_747_tgt simp_alive_peephole apply bitvec_Select_747 @@ -3620,7 +3620,7 @@ theorem alive_Select_747 (w : Nat) : Select_747_src w ⊑ Select_747_tgt w := %r = and %nota, %b -/ -def Select_858_src (w : Nat) := +def alive_Select_858_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -3629,7 +3629,7 @@ def Select_858_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def Select_858_tgt (w : Nat):= +def alive_Select_858_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -3637,8 +3637,8 @@ def Select_858_tgt (w : Nat):= %v3 = "llvm.and" (%v2,%b) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_Select_858 (w : Nat) : Select_858_src w ⊑ Select_858_tgt w := by - unfold Select_858_src Select_858_tgt +theorem alive_Select_858 (w : Nat) : alive_Select_858_src w ⊑ alive_Select_858_tgt w := by + unfold alive_Select_858_src alive_Select_858_tgt simp_alive_peephole apply bitvec_Select_858 @@ -3654,7 +3654,7 @@ theorem alive_Select_858 (w : Nat) : Select_858_src w ⊑ Select_858_tgt w := %r = or %nota, %b -/ -def Select_859'_src (w : Nat) := +def alive_Select_859'_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -3663,7 +3663,7 @@ def Select_859'_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def Select_859'_tgt (w : Nat):= +def alive_Select_859'_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -3671,8 +3671,8 @@ def Select_859'_tgt (w : Nat):= %v3 = "llvm.or" (%v2,%b) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_Select_859' (w : Nat) : Select_859'_src w ⊑ Select_859'_tgt w := by - unfold Select_859'_src Select_859'_tgt +theorem alive_Select_859' (w : Nat) : alive_Select_859'_src w ⊑ alive_Select_859'_tgt w := by + unfold alive_Select_859'_src alive_Select_859'_tgt simp_alive_peephole apply bitvec_Select_859' @@ -3688,7 +3688,7 @@ theorem alive_Select_859' (w : Nat) : Select_859'_src w ⊑ Select_859'_tgt w %r = select i1 %val, %Y, %X -/ -def Select_1087_src (w : Nat) := +def alive_Select_1087_src (w : Nat) := [mlir_icom (w)| { ^bb0(%Y : _, %X : _, %val : _): %v1 = "llvm.mlir.constant" () { value = 1 : 1 } :() -> (i1) @@ -3697,7 +3697,7 @@ def Select_1087_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def Select_1087_tgt (w : Nat):= +def alive_Select_1087_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%Y : _, %X : _, %val : _): %v1 = "llvm.mlir.constant" () { value = 1 : 1 } :() -> (i1) @@ -3705,8 +3705,8 @@ def Select_1087_tgt (w : Nat):= %v3 = "llvm.select" (%val,%Y,%X) : (_, _, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_Select_1087 (w : Nat) : Select_1087_src w ⊑ Select_1087_tgt w := by - unfold Select_1087_src Select_1087_tgt +theorem alive_Select_1087 (w : Nat) : alive_Select_1087_src w ⊑ alive_Select_1087_tgt w := by + unfold alive_Select_1087_src alive_Select_1087_tgt simp_alive_peephole apply bitvec_Select_1087 @@ -3720,7 +3720,7 @@ theorem alive_Select_1087 (w : Nat) : Select_1087_src w ⊑ Select_1087_tgt w %r = %X -/ -def Select_1100_src (w : Nat) := +def alive_Select_1100_src (w : Nat) := [mlir_icom (w)| { ^bb0(%Y : _, %X : _): %v1 = "llvm.mlir.constant" () { value = 1 : 1 } :() -> (i1) @@ -3728,14 +3728,14 @@ def Select_1100_src (w : Nat) := "llvm.return" (%v2) : (_) -> () }] -def Select_1100_tgt (w : Nat):= +def alive_Select_1100_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%Y : _, %X : _): %v1 = "llvm.copy" (%X) : (_) -> (_) "llvm.return" (%v1) : (_) -> () }] -theorem alive_Select_1100 (w : Nat) : Select_1100_src w ⊑ Select_1100_tgt w := by - unfold Select_1100_src Select_1100_tgt +theorem alive_Select_1100 (w : Nat) : alive_Select_1100_src w ⊑ alive_Select_1100_tgt w := by + unfold alive_Select_1100_src alive_Select_1100_tgt simp_alive_peephole apply bitvec_Select_1100 @@ -3749,7 +3749,7 @@ theorem alive_Select_1100 (w : Nat) : Select_1100_src w ⊑ Select_1100_tgt w %r = %Y -/ -def Select_1105_src (w : Nat) := +def alive_Select_1105_src (w : Nat) := [mlir_icom (w)| { ^bb0(%Y : _, %X : _): %v1 = "llvm.mlir.constant" () { value = 0 : 1 } :() -> (i1) @@ -3757,14 +3757,14 @@ def Select_1105_src (w : Nat) := "llvm.return" (%v2) : (_) -> () }] -def Select_1105_tgt (w : Nat):= +def alive_Select_1105_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%Y : _, %X : _): %v1 = "llvm.copy" (%Y) : (_) -> (_) "llvm.return" (%v1) : (_) -> () }] -theorem alive_Select_1105 (w : Nat) : Select_1105_src w ⊑ Select_1105_tgt w := by - unfold Select_1105_src Select_1105_tgt +theorem alive_Select_1105 (w : Nat) : alive_Select_1105_src w ⊑ alive_Select_1105_tgt w := by + unfold alive_Select_1105_src alive_Select_1105_tgt simp_alive_peephole apply bitvec_Select_1105 @@ -3780,7 +3780,7 @@ theorem alive_Select_1105 (w : Nat) : Select_1105_src w ⊑ Select_1105_tgt w %r = and %X, (-1 u>> C) -/ -def InstCombineShift__239_src (w : Nat) := +def alive_InstCombineShift__239_src (w : Nat) := [mlir_icom (w)| { ^bb0(%X : _, %C : _): %v1 = "llvm.shl" (%X,%C) : (_, _) -> (_) @@ -3788,7 +3788,7 @@ def InstCombineShift__239_src (w : Nat) := "llvm.return" (%v2) : (_) -> () }] -def InstCombineShift__239_tgt (w : Nat):= +def alive_InstCombineShift__239_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%X : _, %C : _): %v1 = "llvm.shl" (%X,%C) : (_, _) -> (_) @@ -3797,8 +3797,8 @@ def InstCombineShift__239_tgt (w : Nat):= %v4 = "llvm.and" (%X,%v3) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_InstCombineShift__239 (w : Nat) : InstCombineShift__239_src w ⊑ InstCombineShift__239_tgt w := by - unfold InstCombineShift__239_src InstCombineShift__239_tgt +theorem alive_InstCombineShift__239 (w : Nat) : alive_InstCombineShift__239_src w ⊑ alive_InstCombineShift__239_tgt w := by + unfold alive_InstCombineShift__239_src alive_InstCombineShift__239_tgt simp_alive_peephole apply bitvec_InstCombineShift__239 @@ -3814,7 +3814,7 @@ theorem alive_InstCombineShift__239 (w : Nat) : InstCombineShift__239_src w %r = and %X, (-1 << C) -/ -def InstCombineShift__279_src (w : Nat) := +def alive_InstCombineShift__279_src (w : Nat) := [mlir_icom (w)| { ^bb0(%X : _, %C : _): %v1 = "llvm.lshr" (%X,%C) : (_, _) -> (_) @@ -3822,7 +3822,7 @@ def InstCombineShift__279_src (w : Nat) := "llvm.return" (%v2) : (_) -> () }] -def InstCombineShift__279_tgt (w : Nat):= +def alive_InstCombineShift__279_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%X : _, %C : _): %v1 = "llvm.lshr" (%X,%C) : (_, _) -> (_) @@ -3831,8 +3831,8 @@ def InstCombineShift__279_tgt (w : Nat):= %v4 = "llvm.and" (%X,%v3) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_InstCombineShift__279 (w : Nat) : InstCombineShift__279_src w ⊑ InstCombineShift__279_tgt w := by - unfold InstCombineShift__279_src InstCombineShift__279_tgt +theorem alive_InstCombineShift__279 (w : Nat) : alive_InstCombineShift__279_src w ⊑ alive_InstCombineShift__279_tgt w := by + unfold alive_InstCombineShift__279_src alive_InstCombineShift__279_tgt simp_alive_peephole apply bitvec_InstCombineShift__279 @@ -3854,7 +3854,7 @@ theorem alive_InstCombineShift__279 (w : Nat) : InstCombineShift__279_src w %r = xor %a, %y2 -/ -def InstCombineShift__440_src (w : Nat) := +def alive_InstCombineShift__440_src (w : Nat) := [mlir_icom (w)| { ^bb0(%Y : _, %X : _, %C : _, %C2 : _): %v1 = "llvm.lshr" (%X,%C) : (_, _) -> (_) @@ -3864,7 +3864,7 @@ def InstCombineShift__440_src (w : Nat) := "llvm.return" (%v4) : (_) -> () }] -def InstCombineShift__440_tgt (w : Nat):= +def alive_InstCombineShift__440_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%Y : _, %X : _, %C : _, %C2 : _): %v1 = "llvm.shl" (%C2,%C) : (_, _) -> (_) @@ -3876,8 +3876,8 @@ def InstCombineShift__440_tgt (w : Nat):= %v7 = "llvm.xor" (%v2,%v3) : (_, _) -> (_) "llvm.return" (%v7) : (_) -> () }] -theorem alive_InstCombineShift__440 (w : Nat) : InstCombineShift__440_src w ⊑ InstCombineShift__440_tgt w := by - unfold InstCombineShift__440_src InstCombineShift__440_tgt +theorem alive_InstCombineShift__440 (w : Nat) : alive_InstCombineShift__440_src w ⊑ alive_InstCombineShift__440_tgt w := by + unfold alive_InstCombineShift__440_src alive_InstCombineShift__440_tgt simp_alive_peephole apply bitvec_InstCombineShift__440 @@ -3899,7 +3899,7 @@ theorem alive_InstCombineShift__440 (w : Nat) : InstCombineShift__440_src w %r = or %a, %s2 -/ -def InstCombineShift__476_src (w : Nat) := +def alive_InstCombineShift__476_src (w : Nat) := [mlir_icom (w)| { ^bb0(%Y : _, %X : _, %C : _, %C2 : _): %v1 = "llvm.lshr" (%X,%C) : (_, _) -> (_) @@ -3909,7 +3909,7 @@ def InstCombineShift__476_src (w : Nat) := "llvm.return" (%v4) : (_) -> () }] -def InstCombineShift__476_tgt (w : Nat):= +def alive_InstCombineShift__476_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%Y : _, %X : _, %C : _, %C2 : _): %v1 = "llvm.shl" (%Y,%C) : (_, _) -> (_) @@ -3921,8 +3921,8 @@ def InstCombineShift__476_tgt (w : Nat):= %v7 = "llvm.or" (%v3,%v1) : (_, _) -> (_) "llvm.return" (%v7) : (_) -> () }] -theorem alive_InstCombineShift__476 (w : Nat) : InstCombineShift__476_src w ⊑ InstCombineShift__476_tgt w := by - unfold InstCombineShift__476_src InstCombineShift__476_tgt +theorem alive_InstCombineShift__476 (w : Nat) : alive_InstCombineShift__476_src w ⊑ alive_InstCombineShift__476_tgt w := by + unfold alive_InstCombineShift__476_src alive_InstCombineShift__476_tgt simp_alive_peephole apply bitvec_InstCombineShift__476 @@ -3939,7 +3939,7 @@ theorem alive_InstCombineShift__476 (w : Nat) : InstCombineShift__476_src w %r = xor %s2, (C2 u>> C) -/ -def InstCombineShift__497_src (w : Nat) := +def alive_InstCombineShift__497_src (w : Nat) := [mlir_icom (w)| { ^bb0(%X : _, %C : _, %C2 : _): %v1 = "llvm.xor" (%X,%C2) : (_, _) -> (_) @@ -3947,7 +3947,7 @@ def InstCombineShift__497_src (w : Nat) := "llvm.return" (%v2) : (_) -> () }] -def InstCombineShift__497_tgt (w : Nat):= +def alive_InstCombineShift__497_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%X : _, %C : _, %C2 : _): %v1 = "llvm.lshr" (%X,%C) : (_, _) -> (_) @@ -3956,8 +3956,8 @@ def InstCombineShift__497_tgt (w : Nat):= %v4 = "llvm.xor" (%v1,%v3) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_InstCombineShift__497 (w : Nat) : InstCombineShift__497_src w ⊑ InstCombineShift__497_tgt w := by - unfold InstCombineShift__497_src InstCombineShift__497_tgt +theorem alive_InstCombineShift__497 (w : Nat) : alive_InstCombineShift__497_src w ⊑ alive_InstCombineShift__497_tgt w := by + unfold alive_InstCombineShift__497_src alive_InstCombineShift__497_tgt simp_alive_peephole apply bitvec_InstCombineShift__497 @@ -3974,7 +3974,7 @@ theorem alive_InstCombineShift__497 (w : Nat) : InstCombineShift__497_src w %r = add %s2, (C2 << C) -/ -def InstCombineShift__497'''_src (w : Nat) := +def alive_InstCombineShift__497'''_src (w : Nat) := [mlir_icom (w)| { ^bb0(%X : _, %C : _, %C2 : _): %v1 = "llvm.add" (%X,%C2) : (_, _) -> (_) @@ -3982,7 +3982,7 @@ def InstCombineShift__497'''_src (w : Nat) := "llvm.return" (%v2) : (_) -> () }] -def InstCombineShift__497'''_tgt (w : Nat):= +def alive_InstCombineShift__497'''_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%X : _, %C : _, %C2 : _): %v1 = "llvm.shl" (%X,%C) : (_, _) -> (_) @@ -3991,8 +3991,8 @@ def InstCombineShift__497'''_tgt (w : Nat):= %v4 = "llvm.add" (%v1,%v3) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_InstCombineShift__497''' (w : Nat) : InstCombineShift__497'''_src w ⊑ InstCombineShift__497'''_tgt w := by - unfold InstCombineShift__497'''_src InstCombineShift__497'''_tgt +theorem alive_InstCombineShift__497''' (w : Nat) : alive_InstCombineShift__497'''_src w ⊑ alive_InstCombineShift__497'''_tgt w := by + unfold alive_InstCombineShift__497'''_src alive_InstCombineShift__497'''_tgt simp_alive_peephole apply bitvec_InstCombineShift__497''' @@ -4008,7 +4008,7 @@ theorem alive_InstCombineShift__497''' (w : Nat) : InstCombineShift__497'''_src %r = and %X, (-1 u>> C) -/ -def InstCombineShift__582_src (w : Nat) := +def alive_InstCombineShift__582_src (w : Nat) := [mlir_icom (w)| { ^bb0(%X : _, %C : _): %v1 = "llvm.shl" (%X,%C) : (_, _) -> (_) @@ -4016,7 +4016,7 @@ def InstCombineShift__582_src (w : Nat) := "llvm.return" (%v2) : (_) -> () }] -def InstCombineShift__582_tgt (w : Nat):= +def alive_InstCombineShift__582_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%X : _, %C : _): %v1 = "llvm.shl" (%X,%C) : (_, _) -> (_) @@ -4025,7 +4025,7 @@ def InstCombineShift__582_tgt (w : Nat):= %v4 = "llvm.and" (%X,%v3) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_InstCombineShift__582 (w : Nat) : InstCombineShift__582_src w ⊑ InstCombineShift__582_tgt w := by - unfold InstCombineShift__582_src InstCombineShift__582_tgt +theorem alive_InstCombineShift__582 (w : Nat) : alive_InstCombineShift__582_src w ⊑ alive_InstCombineShift__582_tgt w := by + unfold alive_InstCombineShift__582_src alive_InstCombineShift__582_tgt simp_alive_peephole apply bitvec_InstCombineShift__582 diff --git a/SSA/Projects/InstCombine/LLVM/Transform.lean b/SSA/Projects/InstCombine/LLVM/Transform.lean index 0ec0866d6..8d9508b5f 100644 --- a/SSA/Projects/InstCombine/LLVM/Transform.lean +++ b/SSA/Projects/InstCombine/LLVM/Transform.lean @@ -407,7 +407,12 @@ def mkExpr (Γ : Context φ) (opStx : Op φ) : ReaderM (Σ ty, Expr Γ ty) := do | "llvm.sub" => pure (MOp.sub w₁) | "llvm.sdiv" => pure (MOp.sdiv w₁) | "llvm.udiv" => pure (MOp.udiv w₁) - --| "llvm.icmp" => return InstCombine.Op.icmp v₁.width + | "llvm.icmp" => + match opStx.attrs.find_str "type" with + | .some "eq" => + pure <| MOp.icmp InstCombine.IntPredicate.eq w₁ + | .none => + throw <| .unsupportedOp s!"expected attribute 'type' on operation 'icmp: '{opStx.name}'" | opstr => throw <| .unsupportedOp s!"Unsuported operation or invalid arguments '{opstr}'" if hty : w₁ = w₂ then let binOp ← (mkBinOp op v₁ (hty ▸ v₂) : ExceptM _) diff --git a/SSA/Projects/MLIRSyntax/AST.lean b/SSA/Projects/MLIRSyntax/AST.lean index 7c235f9cc..0e7df6d16 100644 --- a/SSA/Projects/MLIRSyntax/AST.lean +++ b/SSA/Projects/MLIRSyntax/AST.lean @@ -333,11 +333,16 @@ def AttrDict.find_nat {φ} (attrs : AttrDict φ) (name : String) : Option Nat := | _ => .none def AttrDict.find_int {φ} (attrs : AttrDict φ) - (name : String): Option (Int × MLIRType φ) := + (name : String) : Option (Int × MLIRType φ) := match attrs.find name with | .some (AttrValue.int i ty) => .some (i, ty) | _ => .none +def AttrDict.find_str {φ} (attrs : AttrDict φ) (name : String) : Option String := + match attrs.find name with + | .some (AttrValue.str s) => .some s + | _ => .none + def AttrDict.find_int' {φ} (attrs : AttrDict φ) (name : String): Option Int := match attrs.find name with | .some (AttrValue.int i _) => .some i @@ -400,4 +405,4 @@ def Region.setArgs {φ} (bb: Region φ) (args: List (SSAVal × MLIRType φ)) : R match bb with | (Region.mk name _ ops) => (Region.mk name args ops) -end MLIR.AST \ No newline at end of file +end MLIR.AST From a6ada9e404af277b6f36f8f8ce88b575a81c3354 Mon Sep 17 00:00:00 2001 From: Siddharth Bhat Date: Tue, 31 Oct 2023 09:50:54 +0000 Subject: [PATCH 04/12] add support for icmp.* --- .../InstCombine/AliveAutoGenerated.lean | 200 +++++++++--------- SSA/Projects/InstCombine/LLVM/Transform.lean | 22 +- 2 files changed, 113 insertions(+), 109 deletions(-) diff --git a/SSA/Projects/InstCombine/AliveAutoGenerated.lean b/SSA/Projects/InstCombine/AliveAutoGenerated.lean index 1346911d1..01672b260 100644 --- a/SSA/Projects/InstCombine/AliveAutoGenerated.lean +++ b/SSA/Projects/InstCombine/AliveAutoGenerated.lean @@ -722,9 +722,9 @@ def alive_AndOrXor_698_src (w : Nat) := %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) %v2 = "llvm.and" (%a,%d) : (_, _) -> (_) %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v4 = "llvm.icmp eq " (%v1,%v3) : (_, _) -> (_) + %v4 = "llvm.icmp.eq" (%v1,%v3) : (_, _) -> (_) %v5 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v6 = "llvm.icmp eq " (%v2,%v5) : (_, _) -> (_) + %v6 = "llvm.icmp.eq" (%v2,%v5) : (_, _) -> (_) %v7 = "llvm.and" (%v4,%v6) : (_, _) -> (i1) "llvm.return" (%v7) : (i1) -> () }] @@ -737,11 +737,11 @@ def alive_AndOrXor_698_tgt (w : Nat):= %v3 = "llvm.and" (%a,%b) : (_, _) -> (_) %v4 = "llvm.and" (%a,%d) : (_, _) -> (_) %v5 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v6 = "llvm.icmp eq " (%v3,%v5) : (_, _) -> (_) + %v6 = "llvm.icmp.eq" (%v3,%v5) : (_, _) -> (_) %v7 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v8 = "llvm.icmp eq " (%v4,%v7) : (_, _) -> (_) + %v8 = "llvm.icmp.eq" (%v4,%v7) : (_, _) -> (_) %v9 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v10 = "llvm.icmp eq " (%v2,%v9) : (_, _) -> (_) + %v10 = "llvm.icmp.eq" (%v2,%v9) : (_, _) -> (_) "llvm.return" (%v10) : (i1) -> () }] theorem alive_AndOrXor_698 : alive_AndOrXor_698_src ⊑ alive_AndOrXor_698_tgt := by @@ -774,8 +774,8 @@ def alive_AndOrXor_709_src (w : Nat) := ^bb0(%a : _, %b : _, %d : _): %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) %v2 = "llvm.and" (%a,%d) : (_, _) -> (_) - %v3 = "llvm.icmp" (%v1,%b) { type = "eq" } : (_, _) -> (_) - %v4 = "llvm.icmp" (%v2,%d) { type = "eq" } : (_, _) -> (_) + %v3 = "llvm.icmp.eq" (%v1,%b) : (_, _) -> (_) + %v4 = "llvm.icmp.eq" (%v2,%d) : (_, _) -> (_) %v5 = "llvm.and" (%v3,%v4) : (_, _) -> (i1) "llvm.return" (%v5) : (i1) -> () }] @@ -787,9 +787,9 @@ def alive_AndOrXor_709_tgt (w : Nat):= %v2 = "llvm.and" (%a,%v1) : (_, _) -> (_) %v3 = "llvm.and" (%a,%b) : (_, _) -> (_) %v4 = "llvm.and" (%a,%d) : (_, _) -> (_) - %v5 = "llvm.icmp eq " (%v3,%b) : (_, _) -> (_) - %v6 = "llvm.icmp eq " (%v4,%d) : (_, _) -> (_) - %v7 = "llvm.icmp eq " (%v2,%v1) : (_, _) -> (_) + %v5 = "llvm.icmp.eq" (%v3,%b) : (_, _) -> (_) + %v6 = "llvm.icmp.eq" (%v4,%d) : (_, _) -> (_) + %v7 = "llvm.icmp.eq" (%v2,%v1) : (_, _) -> (_) "llvm.return" (%v7) : (i1) -> () }] theorem alive_AndOrXor_709 : alive_AndOrXor_709_src ⊑ alive_AndOrXor_709_tgt := by @@ -822,8 +822,8 @@ def alive_AndOrXor_716_src (w : Nat) := ^bb0(%a : _, %b : _, %d : _): %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) %v2 = "llvm.and" (%a,%d) : (_, _) -> (_) - %v3 = "llvm.icmp eq " (%v1,%a) : (_, _) -> (_) - %v4 = "llvm.icmp eq " (%v2,%a) : (_, _) -> (_) + %v3 = "llvm.icmp.eq" (%v1,%a) : (_, _) -> (_) + %v4 = "llvm.icmp.eq" (%v2,%a) : (_, _) -> (_) %v5 = "llvm.and" (%v3,%v4) : (_, _) -> (i1) "llvm.return" (%v5) : (i1) -> () }] @@ -835,9 +835,9 @@ def alive_AndOrXor_716_tgt (w : Nat):= %v2 = "llvm.and" (%a,%v1) : (_, _) -> (_) %v3 = "llvm.and" (%a,%b) : (_, _) -> (_) %v4 = "llvm.and" (%a,%d) : (_, _) -> (_) - %v5 = "llvm.icmp eq " (%v3,%a) : (_, _) -> (_) - %v6 = "llvm.icmp eq " (%v4,%a) : (_, _) -> (_) - %v7 = "llvm.icmp eq " (%v2,%a) : (_, _) -> (_) + %v5 = "llvm.icmp.eq" (%v3,%a) : (_, _) -> (_) + %v6 = "llvm.icmp.eq" (%v4,%a) : (_, _) -> (_) + %v7 = "llvm.icmp.eq" (%v2,%a) : (_, _) -> (_) "llvm.return" (%v7) : (i1) -> () }] theorem alive_AndOrXor_716 : alive_AndOrXor_716_src ⊑ alive_AndOrXor_716_tgt := by @@ -862,8 +862,8 @@ theorem alive_AndOrXor_716 : alive_AndOrXor_716_src ⊑ alive_AndOrXor_716_tgt : def alive_AndOrXor_794_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %b : _): - %v1 = "llvm.icmp sgt " (%a,%b) : (_, _) -> (_) - %v2 = "llvm.icmp ne " (%a,%b) : (_, _) -> (_) + %v1 = "llvm.icmp.sgt" (%a,%b) : (_, _) -> (_) + %v2 = "llvm.icmp.ne" (%a,%b) : (_, _) -> (_) %v3 = "llvm.and" (%v1,%v2) : (_, _) -> (i1) "llvm.return" (%v3) : (i1) -> () }] @@ -871,9 +871,9 @@ def alive_AndOrXor_794_src (w : Nat) := def alive_AndOrXor_794_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _, %b : _): - %v1 = "llvm.icmp sgt " (%a,%b) : (_, _) -> (_) - %v2 = "llvm.icmp ne " (%a,%b) : (_, _) -> (_) - %v3 = "llvm.icmp sgt " (%a,%b) : (_, _) -> (_) + %v1 = "llvm.icmp.sgt" (%a,%b) : (_, _) -> (_) + %v2 = "llvm.icmp.ne" (%a,%b) : (_, _) -> (_) + %v3 = "llvm.icmp.sgt" (%a,%b) : (_, _) -> (_) "llvm.return" (%v3) : (i1) -> () }] theorem alive_AndOrXor_794 : alive_AndOrXor_794_src ⊑ alive_AndOrXor_794_tgt := by @@ -900,9 +900,9 @@ def alive_AndOrXor_827_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v2 = "llvm.icmp eq " (%a,%v1) : (_, _) -> (_) + %v2 = "llvm.icmp.eq" (%a,%v1) : (_, _) -> (_) %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v4 = "llvm.icmp eq " (%b,%v3) : (_, _) -> (_) + %v4 = "llvm.icmp.eq" (%b,%v3) : (_, _) -> (_) %v5 = "llvm.and" (%v2,%v4) : (_, _) -> (i1) "llvm.return" (%v5) : (i1) -> () }] @@ -912,11 +912,11 @@ def alive_AndOrXor_827_tgt (w : Nat):= ^bb0(%a : _, %b : _): %v1 = "llvm.or" (%a,%b) : (_, _) -> (_) %v2 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v3 = "llvm.icmp eq " (%a,%v2) : (_, _) -> (_) + %v3 = "llvm.icmp.eq" (%a,%v2) : (_, _) -> (_) %v4 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v5 = "llvm.icmp eq " (%b,%v4) : (_, _) -> (_) + %v5 = "llvm.icmp.eq" (%b,%v4) : (_, _) -> (_) %v6 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v7 = "llvm.icmp eq " (%v1,%v6) : (_, _) -> (_) + %v7 = "llvm.icmp.eq" (%v1,%v6) : (_, _) -> (_) "llvm.return" (%v7) : (i1) -> () }] theorem alive_AndOrXor_827 : alive_AndOrXor_827_src ⊑ alive_AndOrXor_827_tgt := by @@ -941,8 +941,8 @@ theorem alive_AndOrXor_827 : alive_AndOrXor_827_src ⊑ alive_AndOrXor_827_tgt : def alive_AndOrXor_887_2_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %C1 : _): - %v1 = "llvm.icmp eq " (%a,%C1) : (_, _) -> (_) - %v2 = "llvm.icmp ne " (%a,%C1) : (_, _) -> (_) + %v1 = "llvm.icmp.eq" (%a,%C1) : (_, _) -> (_) + %v2 = "llvm.icmp.ne" (%a,%C1) : (_, _) -> (_) %v3 = "llvm.and" (%v1,%v2) : (_, _) -> (i1) "llvm.return" (%v3) : (i1) -> () }] @@ -950,8 +950,8 @@ def alive_AndOrXor_887_2_src (w : Nat) := def alive_AndOrXor_887_2_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _, %C1 : _): - %v1 = "llvm.icmp eq " (%a,%C1) : (_, _) -> (_) - %v2 = "llvm.icmp ne " (%a,%C1) : (_, _) -> (_) + %v1 = "llvm.icmp.eq" (%a,%C1) : (_, _) -> (_) + %v2 = "llvm.icmp.ne" (%a,%C1) : (_, _) -> (_) %v3 = "llvm.mlir.constant" () { value = 0 : 1 } :() -> (i1) %v4 = "llvm.copy" (%v3) : (i1) -> (i1) "llvm.return" (%v4) : (i1) -> () @@ -1263,8 +1263,8 @@ theorem alive_AndOrXor_1294_A__B__A__B___A__B (w : Nat) : alive_AndOrXor_1294_A def alive_AndOrXor_1683_1_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %b : _): - %v1 = "llvm.icmp ugt " (%a,%b) : (_, _) -> (_) - %v2 = "llvm.icmp eq " (%a,%b) : (_, _) -> (_) + %v1 = "llvm.icmp.ugt" (%a,%b) : (_, _) -> (_) + %v2 = "llvm.icmp.eq" (%a,%b) : (_, _) -> (_) %v3 = "llvm.or" (%v1,%v2) : (_, _) -> (i1) "llvm.return" (%v3) : (i1) -> () }] @@ -1272,9 +1272,9 @@ def alive_AndOrXor_1683_1_src (w : Nat) := def alive_AndOrXor_1683_1_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _, %b : _): - %v1 = "llvm.icmp ugt " (%a,%b) : (_, _) -> (_) - %v2 = "llvm.icmp eq " (%a,%b) : (_, _) -> (_) - %v3 = "llvm.icmp uge " (%a,%b) : (_, _) -> (_) + %v1 = "llvm.icmp.ugt" (%a,%b) : (_, _) -> (_) + %v2 = "llvm.icmp.eq" (%a,%b) : (_, _) -> (_) + %v3 = "llvm.icmp.uge" (%a,%b) : (_, _) -> (_) "llvm.return" (%v3) : (i1) -> () }] theorem alive_AndOrXor_1683_1 : alive_AndOrXor_1683_1_src ⊑ alive_AndOrXor_1683_1_tgt := by @@ -1299,8 +1299,8 @@ theorem alive_AndOrXor_1683_1 : alive_AndOrXor_1683_1_src ⊑ alive_AndOrXor_168 def alive_AndOrXor_1683_2_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %b : _): - %v1 = "llvm.icmp uge " (%a,%b) : (_, _) -> (_) - %v2 = "llvm.icmp ne " (%a,%b) : (_, _) -> (_) + %v1 = "llvm.icmp.uge" (%a,%b) : (_, _) -> (_) + %v2 = "llvm.icmp.ne" (%a,%b) : (_, _) -> (_) %v3 = "llvm.or" (%v1,%v2) : (_, _) -> (i1) "llvm.return" (%v3) : (i1) -> () }] @@ -1308,8 +1308,8 @@ def alive_AndOrXor_1683_2_src (w : Nat) := def alive_AndOrXor_1683_2_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _, %b : _): - %v1 = "llvm.icmp uge " (%a,%b) : (_, _) -> (_) - %v2 = "llvm.icmp ne " (%a,%b) : (_, _) -> (_) + %v1 = "llvm.icmp.uge" (%a,%b) : (_, _) -> (_) + %v2 = "llvm.icmp.ne" (%a,%b) : (_, _) -> (_) %v3 = "llvm.mlir.constant" () { value = 1 : 1 } :() -> (i1) %v4 = "llvm.copy" (%v3) : (i1) -> (i1) "llvm.return" (%v4) : (i1) -> () @@ -1338,8 +1338,8 @@ def alive_AndOrXor_1704_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v2 = "llvm.icmp eq " (%B,%v1) : (_, _) -> (_) - %v3 = "llvm.icmp ult " (%A,%B) : (_, _) -> (_) + %v2 = "llvm.icmp.eq" (%B,%v1) : (_, _) -> (_) + %v3 = "llvm.icmp.ult" (%A,%B) : (_, _) -> (_) %v4 = "llvm.or" (%v2,%v3) : (_, _) -> (i1) "llvm.return" (%v4) : (i1) -> () }] @@ -1350,9 +1350,9 @@ def alive_AndOrXor_1704_tgt (w : Nat):= %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.add" (%B,%v1) : (_, _) -> (_) %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v4 = "llvm.icmp eq " (%B,%v3) : (_, _) -> (_) - %v5 = "llvm.icmp ult " (%A,%B) : (_, _) -> (_) - %v6 = "llvm.icmp uge " (%v2,%A) : (_, _) -> (_) + %v4 = "llvm.icmp.eq" (%B,%v3) : (_, _) -> (_) + %v5 = "llvm.icmp.ult" (%A,%B) : (_, _) -> (_) + %v6 = "llvm.icmp.uge" (%v2,%A) : (_, _) -> (_) "llvm.return" (%v6) : (i1) -> () }] theorem alive_AndOrXor_1704 : alive_AndOrXor_1704_src ⊑ alive_AndOrXor_1704_tgt := by @@ -1379,8 +1379,8 @@ def alive_AndOrXor_1705_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v2 = "llvm.icmp eq " (%B,%v1) : (_, _) -> (_) - %v3 = "llvm.icmp ugt " (%B,%A) : (_, _) -> (_) + %v2 = "llvm.icmp.eq" (%B,%v1) : (_, _) -> (_) + %v3 = "llvm.icmp.ugt" (%B,%A) : (_, _) -> (_) %v4 = "llvm.or" (%v2,%v3) : (_, _) -> (i1) "llvm.return" (%v4) : (i1) -> () }] @@ -1391,9 +1391,9 @@ def alive_AndOrXor_1705_tgt (w : Nat):= %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.add" (%B,%v1) : (_, _) -> (_) %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v4 = "llvm.icmp eq " (%B,%v3) : (_, _) -> (_) - %v5 = "llvm.icmp ugt " (%B,%A) : (_, _) -> (_) - %v6 = "llvm.icmp uge " (%v2,%A) : (_, _) -> (_) + %v4 = "llvm.icmp.eq" (%B,%v3) : (_, _) -> (_) + %v5 = "llvm.icmp.ugt" (%B,%A) : (_, _) -> (_) + %v6 = "llvm.icmp.uge" (%v2,%A) : (_, _) -> (_) "llvm.return" (%v6) : (i1) -> () }] theorem alive_AndOrXor_1705 : alive_AndOrXor_1705_src ⊑ alive_AndOrXor_1705_tgt := by @@ -1420,9 +1420,9 @@ def alive_AndOrXor_1733_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v2 = "llvm.icmp ne " (%A,%v1) : (_, _) -> (_) + %v2 = "llvm.icmp.ne" (%A,%v1) : (_, _) -> (_) %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v4 = "llvm.icmp ne " (%B,%v3) : (_, _) -> (_) + %v4 = "llvm.icmp.ne" (%B,%v3) : (_, _) -> (_) %v5 = "llvm.or" (%v2,%v4) : (_, _) -> (i1) "llvm.return" (%v5) : (i1) -> () }] @@ -1432,11 +1432,11 @@ def alive_AndOrXor_1733_tgt (w : Nat):= ^bb0(%A : _, %B : _): %v1 = "llvm.or" (%A,%B) : (_, _) -> (_) %v2 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v3 = "llvm.icmp ne " (%A,%v2) : (_, _) -> (_) + %v3 = "llvm.icmp.ne" (%A,%v2) : (_, _) -> (_) %v4 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v5 = "llvm.icmp ne " (%B,%v4) : (_, _) -> (_) + %v5 = "llvm.icmp.ne" (%B,%v4) : (_, _) -> (_) %v6 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v7 = "llvm.icmp ne " (%v1,%v6) : (_, _) -> (_) + %v7 = "llvm.icmp.ne" (%v1,%v6) : (_, _) -> (_) "llvm.return" (%v7) : (i1) -> () }] theorem alive_AndOrXor_1733 : alive_AndOrXor_1733_src ⊑ alive_AndOrXor_1733_tgt := by @@ -2250,7 +2250,7 @@ theorem alive_AndOrXor_2443 (w : Nat) : alive_AndOrXor_2443_src w ⊑ alive_An def alive_AndOrXor_2453_src (w : Nat) := [mlir_icom (w)| { ^bb0(%y : _, %x : _): - %v1 = "llvm.icmp slt " (%x,%y) : (_, _) -> (_) + %v1 = "llvm.icmp.slt" (%x,%y) : (_, _) -> (_) %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v3 = "llvm.xor" (%v1,%v2) : (_, _) -> (i1) "llvm.return" (%v3) : (i1) -> () @@ -2259,8 +2259,8 @@ def alive_AndOrXor_2453_src (w : Nat) := def alive_AndOrXor_2453_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%y : _, %x : _): - %v1 = "llvm.icmp slt " (%x,%y) : (_, _) -> (_) - %v2 = "llvm.icmp sge " (%x,%y) : (_, _) -> (_) + %v1 = "llvm.icmp.slt" (%x,%y) : (_, _) -> (_) + %v2 = "llvm.icmp.sge" (%x,%y) : (_, _) -> (_) "llvm.return" (%v2) : (i1) -> () }] theorem alive_AndOrXor_2453 : alive_AndOrXor_2453_src ⊑ alive_AndOrXor_2453_tgt := by @@ -2681,8 +2681,8 @@ theorem alive_AndOrXor_2658 (w : Nat) : alive_AndOrXor_2658_src w ⊑ alive_An def alive_AndOrXor_2663_src (w : Nat) := [mlir_icom (w)| { ^bb0(%a : _, %b : _): - %v1 = "llvm.icmp ule " (%a,%b) : (_, _) -> (_) - %v2 = "llvm.icmp ne " (%a,%b) : (_, _) -> (_) + %v1 = "llvm.icmp.ule" (%a,%b) : (_, _) -> (_) + %v2 = "llvm.icmp.ne" (%a,%b) : (_, _) -> (_) %v3 = "llvm.xor" (%v1,%v2) : (_, _) -> (i1) "llvm.return" (%v3) : (i1) -> () }] @@ -2690,9 +2690,9 @@ def alive_AndOrXor_2663_src (w : Nat) := def alive_AndOrXor_2663_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%a : _, %b : _): - %v1 = "llvm.icmp ule " (%a,%b) : (_, _) -> (_) - %v2 = "llvm.icmp ne " (%a,%b) : (_, _) -> (_) - %v3 = "llvm.icmp uge " (%a,%b) : (_, _) -> (_) + %v1 = "llvm.icmp.ule" (%a,%b) : (_, _) -> (_) + %v2 = "llvm.icmp.ne" (%a,%b) : (_, _) -> (_) + %v3 = "llvm.icmp.uge" (%a,%b) : (_, _) -> (_) "llvm.return" (%v3) : (i1) -> () }] theorem alive_AndOrXor_2663 : alive_AndOrXor_2663_src ⊑ alive_AndOrXor_2663_tgt := by @@ -3042,7 +3042,7 @@ def alive_805_tgt (w : Nat):= %v1 = "llvm.mlir.constant" () { value = 1 : _ } :() -> (_) %v2 = "llvm.add" (%X,%v1) : (_, _) -> (_) %v3 = "llvm.mlir.constant" () { value = 3 : _ } :() -> (_) - %v4 = "llvm.icmp ult " (%v2,%v3) : (_, _) -> (_) + %v4 = "llvm.icmp.ult" (%v2,%v3) : (_, _) -> (_) %v5 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v6 = "llvm.select" (%v4,%X,%v5) : (_, _, _) -> (_) "llvm.return" (%v6) : (_) -> () @@ -3169,7 +3169,7 @@ theorem alive_1030 (w : Nat) : alive_1030_src w ⊑ alive_1030_tgt w := by def alive_Select_637_src (w : Nat) := [mlir_icom (w)| { ^bb0(%Y : _, %X : _, %C : _): - %v1 = "llvm.icmp eq " (%X,%C) : (_, _) -> (_) + %v1 = "llvm.icmp.eq" (%X,%C) : (_, _) -> (_) %v2 = "llvm.select" (%v1,%X,%Y) : (_, _, _) -> (_) "llvm.return" (%v2) : (_) -> () }] @@ -3177,7 +3177,7 @@ def alive_Select_637_src (w : Nat) := def alive_Select_637_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%Y : _, %X : _, %C : _): - %v1 = "llvm.icmp eq " (%X,%C) : (_, _) -> (_) + %v1 = "llvm.icmp.eq" (%X,%C) : (_, _) -> (_) %v2 = "llvm.select" (%v1,%C,%Y) : (_, _, _) -> (_) "llvm.return" (%v2) : (_) -> () }] @@ -3201,7 +3201,7 @@ theorem alive_Select_637 (w : Nat) : alive_Select_637_src w ⊑ alive_Select_6 def alive_Select_641_src (w : Nat) := [mlir_icom (w)| { ^bb0(%Y : _, %X : _, %C : _): - %v1 = "llvm.icmp ne " (%X,%C) : (_, _) -> (_) + %v1 = "llvm.icmp.ne" (%X,%C) : (_, _) -> (_) %v2 = "llvm.select" (%v1,%Y,%X) : (_, _, _) -> (_) "llvm.return" (%v2) : (_) -> () }] @@ -3209,7 +3209,7 @@ def alive_Select_641_src (w : Nat) := def alive_Select_641_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%Y : _, %X : _, %C : _): - %v1 = "llvm.icmp ne " (%X,%C) : (_, _) -> (_) + %v1 = "llvm.icmp.ne" (%X,%C) : (_, _) -> (_) %v2 = "llvm.select" (%v1,%Y,%C) : (_, _, _) -> (_) "llvm.return" (%v2) : (_) -> () }] @@ -3237,9 +3237,9 @@ theorem alive_Select_641 (w : Nat) : alive_Select_641_src w ⊑ alive_Select_6 def alive_Select_699_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %B : _): - %v1 = "llvm.icmp uge " (%A,%B) : (_, _) -> (_) + %v1 = "llvm.icmp.uge" (%A,%B) : (_, _) -> (_) %v2 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) - %v3 = "llvm.icmp uge " (%v2,%B) : (_, _) -> (_) + %v3 = "llvm.icmp.uge" (%v2,%B) : (_, _) -> (_) %v4 = "llvm.select" (%v3,%v2,%B) : (_, _, _) -> (_) "llvm.return" (%v4) : (_) -> () }] @@ -3247,9 +3247,9 @@ def alive_Select_699_src (w : Nat) := def alive_Select_699_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %B : _): - %v1 = "llvm.icmp uge " (%A,%B) : (_, _) -> (_) + %v1 = "llvm.icmp.uge" (%A,%B) : (_, _) -> (_) %v2 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) - %v3 = "llvm.icmp uge " (%v2,%B) : (_, _) -> (_) + %v3 = "llvm.icmp.uge" (%v2,%B) : (_, _) -> (_) %v4 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) "llvm.return" (%v4) : (_) -> () }] @@ -3277,9 +3277,9 @@ theorem alive_Select_699 (w : Nat) : alive_Select_699_src w ⊑ alive_Select_6 def alive_Select_700_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %B : _): - %v1 = "llvm.icmp slt " (%A,%B) : (_, _) -> (_) + %v1 = "llvm.icmp.slt" (%A,%B) : (_, _) -> (_) %v2 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) - %v3 = "llvm.icmp slt " (%v2,%B) : (_, _) -> (_) + %v3 = "llvm.icmp.slt" (%v2,%B) : (_, _) -> (_) %v4 = "llvm.select" (%v3,%v2,%B) : (_, _, _) -> (_) "llvm.return" (%v4) : (_) -> () }] @@ -3287,9 +3287,9 @@ def alive_Select_700_src (w : Nat) := def alive_Select_700_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %B : _): - %v1 = "llvm.icmp slt " (%A,%B) : (_, _) -> (_) + %v1 = "llvm.icmp.slt" (%A,%B) : (_, _) -> (_) %v2 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) - %v3 = "llvm.icmp slt " (%v2,%B) : (_, _) -> (_) + %v3 = "llvm.icmp.slt" (%v2,%B) : (_, _) -> (_) %v4 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) "llvm.return" (%v4) : (_) -> () }] @@ -3317,9 +3317,9 @@ theorem alive_Select_700 (w : Nat) : alive_Select_700_src w ⊑ alive_Select_7 def alive_Select_704_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %B : _): - %v1 = "llvm.icmp slt " (%A,%B) : (_, _) -> (_) + %v1 = "llvm.icmp.slt" (%A,%B) : (_, _) -> (_) %v2 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) - %v3 = "llvm.icmp sge " (%v2,%A) : (_, _) -> (_) + %v3 = "llvm.icmp.sge" (%v2,%A) : (_, _) -> (_) %v4 = "llvm.select" (%v3,%v2,%A) : (_, _, _) -> (_) "llvm.return" (%v4) : (_) -> () }] @@ -3327,9 +3327,9 @@ def alive_Select_704_src (w : Nat) := def alive_Select_704_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %B : _): - %v1 = "llvm.icmp slt " (%A,%B) : (_, _) -> (_) + %v1 = "llvm.icmp.slt" (%A,%B) : (_, _) -> (_) %v2 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) - %v3 = "llvm.icmp sge " (%v2,%A) : (_, _) -> (_) + %v3 = "llvm.icmp.sge" (%v2,%A) : (_, _) -> (_) %v4 = "llvm.copy" (%A) : (_) -> (_) "llvm.return" (%v4) : (_) -> () }] @@ -3357,9 +3357,9 @@ theorem alive_Select_704 (w : Nat) : alive_Select_704_src w ⊑ alive_Select_7 def alive_Select_705_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _, %B : _): - %v1 = "llvm.icmp sge " (%A,%B) : (_, _) -> (_) + %v1 = "llvm.icmp.sge" (%A,%B) : (_, _) -> (_) %v2 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) - %v3 = "llvm.icmp slt " (%v2,%A) : (_, _) -> (_) + %v3 = "llvm.icmp.slt" (%v2,%A) : (_, _) -> (_) %v4 = "llvm.select" (%v3,%v2,%A) : (_, _, _) -> (_) "llvm.return" (%v4) : (_) -> () }] @@ -3367,9 +3367,9 @@ def alive_Select_705_src (w : Nat) := def alive_Select_705_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _, %B : _): - %v1 = "llvm.icmp sge " (%A,%B) : (_, _) -> (_) + %v1 = "llvm.icmp.sge" (%A,%B) : (_, _) -> (_) %v2 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) - %v3 = "llvm.icmp slt " (%v2,%A) : (_, _) -> (_) + %v3 = "llvm.icmp.slt" (%v2,%A) : (_, _) -> (_) %v4 = "llvm.copy" (%A) : (_) -> (_) "llvm.return" (%v4) : (_) -> () }] @@ -3402,12 +3402,12 @@ def alive_Select_740_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v2 = "llvm.icmp sgt " (%A,%v1) : (_, _) -> (_) + %v2 = "llvm.icmp.sgt" (%A,%v1) : (_, _) -> (_) %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v4 = "llvm.sub" (%v3,%A) : (_, _) -> (_) %v5 = "llvm.select" (%v2,%A,%v4) : (_, _, _) -> (_) %v6 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) - %v7 = "llvm.icmp sgt " (%v5,%v6) : (_, _) -> (_) + %v7 = "llvm.icmp.sgt" (%v5,%v6) : (_, _) -> (_) %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v9 = "llvm.sub" (%v8,%v5) : (_, _) -> (_) %v10 = "llvm.select" (%v7,%v5,%v9) : (_, _, _) -> (_) @@ -3418,12 +3418,12 @@ def alive_Select_740_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v2 = "llvm.icmp sgt " (%A,%v1) : (_, _) -> (_) + %v2 = "llvm.icmp.sgt" (%A,%v1) : (_, _) -> (_) %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v4 = "llvm.sub" (%v3,%A) : (_, _) -> (_) %v5 = "llvm.select" (%v2,%A,%v4) : (_, _, _) -> (_) %v6 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) - %v7 = "llvm.icmp sgt " (%v5,%v6) : (_, _) -> (_) + %v7 = "llvm.icmp.sgt" (%v5,%v6) : (_, _) -> (_) %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v9 = "llvm.sub" (%v8,%v5) : (_, _) -> (_) %v10 = "llvm.select" (%v2,%A,%v4) : (_, _, _) -> (_) @@ -3458,12 +3458,12 @@ def alive_Select_741_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v2 = "llvm.icmp sgt " (%A,%v1) : (_, _) -> (_) + %v2 = "llvm.icmp.sgt" (%A,%v1) : (_, _) -> (_) %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v4 = "llvm.sub" (%v3,%A) : (_, _) -> (i1) %v5 = "llvm.select" (%v2,%v4,%A) : (_, _, _) -> (_) %v6 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) - %v7 = "llvm.icmp sgt " (%v5,%v6) : (_, _) -> (_) + %v7 = "llvm.icmp.sgt" (%v5,%v6) : (_, _) -> (_) %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v9 = "llvm.sub" (%v8,%v5) : (_, _) -> (_) %v10 = "llvm.select" (%v7,%v9,%v5) : (_, _, _) -> (_) @@ -3474,12 +3474,12 @@ def alive_Select_741_tgt (w : Nat):= [mlir_icom (w)| { ^bb0(%A : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v2 = "llvm.icmp sgt " (%A,%v1) : (_, _) -> (_) + %v2 = "llvm.icmp.sgt" (%A,%v1) : (_, _) -> (_) %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v4 = "llvm.sub" (%v3,%A) : (_, _) -> (i1) %v5 = "llvm.select" (%v2,%v4,%A) : (_, _, _) -> (_) %v6 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) - %v7 = "llvm.icmp sgt " (%v5,%v6) : (_, _) -> (_) + %v7 = "llvm.icmp.sgt" (%v5,%v6) : (_, _) -> (_) %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v9 = "llvm.sub" (%v8,%v5) : (_, _) -> (_) %v10 = "llvm.select" (%v2,%v4,%A) : (_, _, _) -> (i1) @@ -3515,12 +3515,12 @@ def alive_Select_746_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v2 = "llvm.icmp slt " (%A,%v1) : (_, _) -> (_) + %v2 = "llvm.icmp.slt" (%A,%v1) : (_, _) -> (_) %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v4 = "llvm.sub" (%v3,%A) : (_, _) -> (_) %v5 = "llvm.select" (%v2,%A,%v4) : (_, _, _) -> (_) %v6 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v7 = "llvm.icmp sgt " (%v5,%v6) : (_, _) -> (_) + %v7 = "llvm.icmp.sgt" (%v5,%v6) : (_, _) -> (_) %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v9 = "llvm.sub" (%v8,%v5) : (_, _) -> (_) %v10 = "llvm.select" (%v7,%v5,%v9) : (_, _, _) -> (_) @@ -3533,12 +3533,12 @@ def alive_Select_746_tgt (w : Nat):= %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v2 = "llvm.sub" (%v1,%A) : (_, _) -> (_) %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v4 = "llvm.icmp sgt " (%A,%v3) : (_, _) -> (_) + %v4 = "llvm.icmp.sgt" (%A,%v3) : (_, _) -> (_) %v5 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v6 = "llvm.icmp slt " (%A,%v5) : (_, _) -> (_) + %v6 = "llvm.icmp.slt" (%A,%v5) : (_, _) -> (_) %v7 = "llvm.select" (%v6,%A,%v2) : (_, _, _) -> (_) %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v9 = "llvm.icmp sgt " (%v7,%v8) : (_, _) -> (_) + %v9 = "llvm.icmp.sgt" (%v7,%v8) : (_, _) -> (_) %v10 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v11 = "llvm.sub" (%v10,%v7) : (_, _) -> (_) %v12 = "llvm.select" (%v4,%A,%v2) : (_, _, _) -> (_) @@ -3574,12 +3574,12 @@ def alive_Select_747_src (w : Nat) := [mlir_icom (w)| { ^bb0(%A : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v2 = "llvm.icmp sgt " (%A,%v1) : (_, _) -> (_) + %v2 = "llvm.icmp.sgt" (%A,%v1) : (_, _) -> (_) %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v4 = "llvm.sub" (%v3,%A) : (_, _) -> (_) %v5 = "llvm.select" (%v2,%A,%v4) : (_, _, _) -> (_) %v6 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v7 = "llvm.icmp slt " (%v5,%v6) : (_, _) -> (_) + %v7 = "llvm.icmp.slt" (%v5,%v6) : (_, _) -> (_) %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v9 = "llvm.sub" (%v8,%v5) : (_, _) -> (_) %v10 = "llvm.select" (%v7,%v5,%v9) : (_, _, _) -> (_) @@ -3592,12 +3592,12 @@ def alive_Select_747_tgt (w : Nat):= %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v2 = "llvm.sub" (%v1,%A) : (_, _) -> (_) %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v4 = "llvm.icmp slt " (%A,%v3) : (_, _) -> (_) + %v4 = "llvm.icmp.slt" (%A,%v3) : (_, _) -> (_) %v5 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v6 = "llvm.icmp sgt " (%A,%v5) : (_, _) -> (_) + %v6 = "llvm.icmp.sgt" (%A,%v5) : (_, _) -> (_) %v7 = "llvm.select" (%v6,%A,%v2) : (_, _, _) -> (_) %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v9 = "llvm.icmp slt " (%v7,%v8) : (_, _) -> (_) + %v9 = "llvm.icmp.slt" (%v7,%v8) : (_, _) -> (_) %v10 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v11 = "llvm.sub" (%v10,%v7) : (_, _) -> (_) %v12 = "llvm.select" (%v4,%A,%v2) : (_, _, _) -> (_) diff --git a/SSA/Projects/InstCombine/LLVM/Transform.lean b/SSA/Projects/InstCombine/LLVM/Transform.lean index 8d9508b5f..0e469b023 100644 --- a/SSA/Projects/InstCombine/LLVM/Transform.lean +++ b/SSA/Projects/InstCombine/LLVM/Transform.lean @@ -28,7 +28,7 @@ inductive TransformError | typeError {φ} (expected got : MTy φ) | widthError {φ} (expected got : Width φ) | unsupportedUnaryOp - | unsupportedBinaryOp + | unsupportedBinaryOp (name : String) | unsupportedOp (error : String) | unsupportedType | generic (error : String) @@ -47,7 +47,7 @@ instance : Repr TransformError where | typeError expected got => f!"Type mismatch: expected '{expected}', but 'name' has type '{got}'" | widthError expected got => f!"Type mismatch: {expected} ≠ {got}" | unsupportedUnaryOp => f!"Unsuported unary operation" - | unsupportedBinaryOp => f!"Unsuported binary operation" + | unsupportedBinaryOp name => f!"Unsuported binary operation {name}" | unsupportedOp err => f!"Unsuported operation '{err}'" | unsupportedType => f!"Unsuported type" | generic err => err @@ -305,7 +305,7 @@ def mkBinOp {Γ : Ctxt _} {ty : MTy φ} (op : MOp φ) .nil ⟩ else throw <| .widthError w w' - | _ => throw <| .unsupportedBinaryOp + | op => throw <| .unsupportedBinaryOp s!"{repr op}" def mkIcmp {Γ : Ctxt _} {ty : MTy φ} (op : MOp φ) (e₁ e₂ : Ctxt.Var Γ ty) : ExceptM <| Expr Γ (.bitvec 1) := @@ -407,12 +407,16 @@ def mkExpr (Γ : Context φ) (opStx : Op φ) : ReaderM (Σ ty, Expr Γ ty) := do | "llvm.sub" => pure (MOp.sub w₁) | "llvm.sdiv" => pure (MOp.sdiv w₁) | "llvm.udiv" => pure (MOp.udiv w₁) - | "llvm.icmp" => - match opStx.attrs.find_str "type" with - | .some "eq" => - pure <| MOp.icmp InstCombine.IntPredicate.eq w₁ - | .none => - throw <| .unsupportedOp s!"expected attribute 'type' on operation 'icmp: '{opStx.name}'" + | "llvm.icmp.eq" => pure (MOp.icmp InstCombine.IntPredicate.eq w₁) + | "llvm.icmp.ne" => pure (MOp.icmp InstCombine.IntPredicate.ne w₁) + | "llvm.icmp.ugt" => pure (MOp.icmp InstCombine.IntPredicate.ugt w₁) + | "llvm.icmp.uge" => pure (MOp.icmp InstCombine.IntPredicate.uge w₁) + | "llvm.icmp.ult" => pure (MOp.icmp InstCombine.IntPredicate.ult w₁) + | "llvm.icmp.ule" => pure (MOp.icmp InstCombine.IntPredicate.ule w₁) + | "llvm.icmp.sgt" => pure (MOp.icmp InstCombine.IntPredicate.sgt w₁) + | "llvm.icmp.sge" => pure (MOp.icmp InstCombine.IntPredicate.sge w₁) + | "llvm.icmp.slt" => pure (MOp.icmp InstCombine.IntPredicate.slt w₁) + | "llvm.icmp.sle" => pure (MOp.icmp InstCombine.IntPredicate.sle w₁) | opstr => throw <| .unsupportedOp s!"Unsuported operation or invalid arguments '{opstr}'" if hty : w₁ = w₂ then let binOp ← (mkBinOp op v₁ (hty ▸ v₂) : ExceptM _) From d351e384871cfcd98f788e152e7f2d1a9770893e Mon Sep 17 00:00:00 2001 From: Siddharth Bhat Date: Tue, 31 Oct 2023 10:25:10 +0000 Subject: [PATCH 05/12] toString instances --- SSA/Projects/InstCombine/Base.lean | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/SSA/Projects/InstCombine/Base.lean b/SSA/Projects/InstCombine/Base.lean index d6ea32b9f..89c4d18bd 100644 --- a/SSA/Projects/InstCombine/Base.lean +++ b/SSA/Projects/InstCombine/Base.lean @@ -39,6 +39,19 @@ inductive IntPredicate where | sle deriving Inhabited, DecidableEq, Repr +instance : ToString IntPredicate where + toString + | .eq => "eq" + | .ne => "ne" + | .ugt => "ugt" + | .uge => "uge" + | .ult => "ult" + | .ule => "ule" + | .sgt => "sgt" + | .sge => "sge" + | .slt => "slt" + | .sle => "sle" + inductive MTy (φ : Nat) | bitvec (w : Width φ) : MTy φ deriving DecidableEq, Inhabited @@ -97,6 +110,28 @@ inductive MOp (φ : Nat) : Type | const (w : Width φ) (val : ℤ) : MOp φ deriving Repr, DecidableEq, Inhabited +instance : ToString (MOp φ) where + toString + | .and w => "and" + | .or w => "or" + | .not w => "not" + | .xor w => "xor" + | .shl w => "shl" + | .lshr w => "lshr" + | .ashr w => "ashr" + | .urem w => "urem" + | .srem w => "srem" + | .select w => "select" + | .add w => "add" + | .mul w => "mul" + | .sub w => "sub" + | .neg w => "neg" + | .copy w => "copy" + | .sdiv w => "sdiv" + | .udiv w => "udiv" + | .icmp ty w => s!"icmp {ty}" + | .const w v => s!"const {v}" + abbrev Op := MOp 0 namespace Op From ff38eed6a4acc3ab2001fa17bb89f6d255baa482 Mon Sep 17 00:00:00 2001 From: Siddharth Bhat Date: Tue, 31 Oct 2023 10:25:34 +0000 Subject: [PATCH 06/12] TODO: we should delete mkOpExpr, and add special handlers for each of the cases handled there. Add special handling for icmp making --- SSA/Projects/InstCombine/LLVM/Transform.lean | 22 +++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/SSA/Projects/InstCombine/LLVM/Transform.lean b/SSA/Projects/InstCombine/LLVM/Transform.lean index 0e469b023..f4aa26008 100644 --- a/SSA/Projects/InstCombine/LLVM/Transform.lean +++ b/SSA/Projects/InstCombine/LLVM/Transform.lean @@ -305,7 +305,7 @@ def mkBinOp {Γ : Ctxt _} {ty : MTy φ} (op : MOp φ) .nil ⟩ else throw <| .widthError w w' - | op => throw <| .unsupportedBinaryOp s!"{repr op}" + | op => throw <| .unsupportedBinaryOp s!"unsupported binary operation {op}" def mkIcmp {Γ : Ctxt _} {ty : MTy φ} (op : MOp φ) (e₁ e₂ : Ctxt.Var Γ ty) : ExceptM <| Expr Γ (.bitvec 1) := @@ -318,7 +318,7 @@ def mkIcmp {Γ : Ctxt _} {ty : MTy φ} (op : MOp φ) by simp [OpSignature.outTy, signature, h], .cons (h ▸ e₁) <| .cons (h ▸ e₂) .nil , .nil -⟩ + ⟩ else throw <| .widthError w w' | _ => throw <| .unsupportedOp "unsupported icmp operation" @@ -418,11 +418,19 @@ def mkExpr (Γ : Context φ) (opStx : Op φ) : ReaderM (Σ ty, Expr Γ ty) := do | "llvm.icmp.slt" => pure (MOp.icmp InstCombine.IntPredicate.slt w₁) | "llvm.icmp.sle" => pure (MOp.icmp InstCombine.IntPredicate.sle w₁) | opstr => throw <| .unsupportedOp s!"Unsuported operation or invalid arguments '{opstr}'" - if hty : w₁ = w₂ then - let binOp ← (mkBinOp op v₁ (hty ▸ v₂) : ExceptM _) - return ⟨.bitvec w₁, binOp⟩ - else - throw <| .widthError w₁ w₂ -- s!"mismatched types {ty₁} ≠ {ty₂} in binary op" + match op with + | .icmp .. => + if hty : w₁ = w₂ then + let icmpOp ← (mkIcmp op v₁ (hty ▸ v₂) : ExceptM _) + return ⟨.bitvec 1, icmpOp⟩ + else + throw <| .widthError w₁ w₂ -- s!"mismatched types {ty₁} ≠ {ty₂} in binary op" + | _ => + if hty : w₁ = w₂ then + let binOp ← (mkBinOp op v₁ (hty ▸ v₂) : ExceptM _) + return ⟨.bitvec w₁, binOp⟩ + else + throw <| .widthError w₁ w₂ -- s!"mismatched types {ty₁} ≠ {ty₂} in binary op" | vStx::[] => let ⟨.bitvec w, v⟩ ← TypedSSAVal.mkVal Γ vStx let op ← match opStx.name with From 88d3ef6cff58c07b9eb5f11d22cc0a202ed3a306 Mon Sep 17 00:00:00 2001 From: Siddharth Bhat Date: Wed, 1 Nov 2023 12:15:54 +0000 Subject: [PATCH 07/12] add support for copy, select --- SSA/Core/Util/ConcreteOrMVar.lean | 6 +- .../InstCombine/AliveAutoGenerated.lean | 1401 ++++++++--------- SSA/Projects/InstCombine/LLVM/Transform.lean | 18 +- 3 files changed, 719 insertions(+), 706 deletions(-) diff --git a/SSA/Core/Util/ConcreteOrMVar.lean b/SSA/Core/Util/ConcreteOrMVar.lean index 2c5f1e0c6..ed263c7dd 100644 --- a/SSA/Core/Util/ConcreteOrMVar.lean +++ b/SSA/Core/Util/ConcreteOrMVar.lean @@ -11,6 +11,10 @@ inductive ConcreteOrMVar (α : Type u) (φ : Nat) | mvar (i : Fin φ) deriving DecidableEq, Repr, Inhabited +instance [ToString α] : ToString (ConcreteOrMVar α n) where + toString + | .concrete a => s!"wconcrete({a})" + | .mvar i => s!"wmvar({i})" /-- A coercion from the concrete type `α` to the `ConcreteOrMVar` -/ instance : Coe α (ConcreteOrMVar α φ) := ⟨.concrete⟩ @@ -42,4 +46,4 @@ def instantiate (as : Vector α φ) : ConcreteOrMVar α φ → α | .mvar i => as.get i -end ConcreteOrMVar \ No newline at end of file +end ConcreteOrMVar diff --git a/SSA/Projects/InstCombine/AliveAutoGenerated.lean b/SSA/Projects/InstCombine/AliveAutoGenerated.lean index 01672b260..fdda63d08 100644 --- a/SSA/Projects/InstCombine/AliveAutoGenerated.lean +++ b/SSA/Projects/InstCombine/AliveAutoGenerated.lean @@ -1,4 +1,3 @@ - import SSA.Projects.InstCombine.LLVM.EDSL import SSA.Projects.InstCombine.AliveStatements import SSA.Projects.InstCombine.Refinement @@ -13,7 +12,6 @@ set_option pp.proofs false set_option pp.proofs.withType false - -- Name:AddSub:1043 -- precondition: true /- @@ -30,8 +28,8 @@ set_option pp.proofs.withType false %r = sub %RHS, %or -/ -def alive_AddSub_1043_src (w : Nat) := -[mlir_icom (w)| { +def alive_AddSub_1043_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%C1 : _, %Z : _, %RHS : _): %v1 = "llvm.and" (%Z,%C1) : (_, _) -> (_) %v2 = "llvm.xor" (%v1,%C1) : (_, _) -> (_) @@ -41,8 +39,8 @@ def alive_AddSub_1043_src (w : Nat) := "llvm.return" (%v5) : (_) -> () }] -def alive_AddSub_1043_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AddSub_1043_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%C1 : _, %Z : _, %RHS : _): %v1 = "llvm.not" (%C1) : (_) -> (_) %v2 = "llvm.or" (%Z,%v1) : (_, _) -> (_) @@ -53,7 +51,7 @@ def alive_AddSub_1043_tgt (w : Nat):= %v7 = "llvm.sub" (%RHS,%v2) : (_, _) -> (_) "llvm.return" (%v7) : (_) -> () }] -theorem alive_AddSub_1043 (w : Nat) : alive_AddSub_1043_src w ⊑ alive_AddSub_1043_tgt w := by +theorem alive_AddSub_1043 (w : Nat) : alive_AddSub_1043_src w ⊑ alive_AddSub_1043_tgt w := by unfold alive_AddSub_1043_src alive_AddSub_1043_tgt simp_alive_peephole apply bitvec_AddSub_1043 @@ -68,20 +66,20 @@ theorem alive_AddSub_1043 (w : Nat) : alive_AddSub_1043_src w ⊑ alive_AddSub %r = xor %x, %y -/ -def alive_AddSub_1152_src := +def alive_AddSub_1152_src := [mlir_icom ()| { ^bb0(%y : i1, %x : i1): %v1 = "llvm.add" (%x,%y) : (i1, i1) -> (i1) "llvm.return" (%v1) : (i1) -> () }] -def alive_AddSub_1152_tgt := +def alive_AddSub_1152_tgt := [mlir_icom ()| { ^bb0(%y : i1, %x : i1): %v1 = "llvm.xor" (%x,%y) : (i1, i1) -> (i1) "llvm.return" (%v1) : (i1) -> () }] -theorem alive_AddSub_1152 : alive_AddSub_1152_src ⊑ alive_AddSub_1152_tgt := by +theorem alive_AddSub_1152 : alive_AddSub_1152_src ⊑ alive_AddSub_1152_tgt := by unfold alive_AddSub_1152_src alive_AddSub_1152_tgt simp_alive_peephole apply bitvec_AddSub_1152 @@ -96,21 +94,21 @@ theorem alive_AddSub_1152 : alive_AddSub_1152_src ⊑ alive_AddSub_1152_tgt := b %a = shl %b, 1 -/ -def alive_AddSub_1156_src (w : Nat) := -[mlir_icom (w)| { +def alive_AddSub_1156_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%b : _): %v1 = "llvm.add" (%b,%b) : (_, _) -> (_) "llvm.return" (%v1) : (_) -> () }] -def alive_AddSub_1156_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AddSub_1156_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%b : _): %v1 = "llvm.mlir.constant" () { value = 1 : _ } :() -> (_) %v2 = "llvm.shl" (%b,%v1) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -theorem alive_AddSub_1156 (w : Nat) : alive_AddSub_1156_src w ⊑ alive_AddSub_1156_tgt w := by +theorem alive_AddSub_1156 (w : Nat) : alive_AddSub_1156_src w ⊑ alive_AddSub_1156_tgt w := by unfold alive_AddSub_1156_src alive_AddSub_1156_tgt simp_alive_peephole apply bitvec_AddSub_1156 @@ -127,8 +125,8 @@ theorem alive_AddSub_1156 (w : Nat) : alive_AddSub_1156_src w ⊑ alive_AddSub %c = sub %b, %a -/ -def alive_AddSub_1164_src (w : Nat) := -[mlir_icom (w)| { +def alive_AddSub_1164_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v2 = "llvm.sub" (%v1,%a) : (_, _) -> (_) @@ -136,15 +134,15 @@ def alive_AddSub_1164_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def alive_AddSub_1164_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AddSub_1164_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v2 = "llvm.sub" (%v1,%a) : (_, _) -> (_) %v3 = "llvm.sub" (%b,%a) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_AddSub_1164 (w : Nat) : alive_AddSub_1164_src w ⊑ alive_AddSub_1164_tgt w := by +theorem alive_AddSub_1164 (w : Nat) : alive_AddSub_1164_src w ⊑ alive_AddSub_1164_tgt w := by unfold alive_AddSub_1164_src alive_AddSub_1164_tgt simp_alive_peephole apply bitvec_AddSub_1164 @@ -164,8 +162,8 @@ theorem alive_AddSub_1164 (w : Nat) : alive_AddSub_1164_src w ⊑ alive_AddSub %c = sub 0, %ab -/ -def alive_AddSub_1165_src (w : Nat) := -[mlir_icom (w)| { +def alive_AddSub_1165_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v2 = "llvm.sub" (%v1,%a) : (_, _) -> (_) @@ -175,8 +173,8 @@ def alive_AddSub_1165_src (w : Nat) := "llvm.return" (%v5) : (_) -> () }] -def alive_AddSub_1165_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AddSub_1165_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): %v1 = "llvm.add" (%a,%b) : (_, _) -> (_) %v2 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) @@ -187,7 +185,7 @@ def alive_AddSub_1165_tgt (w : Nat):= %v7 = "llvm.sub" (%v6,%v1) : (_, _) -> (_) "llvm.return" (%v7) : (_) -> () }] -theorem alive_AddSub_1165 (w : Nat) : alive_AddSub_1165_src w ⊑ alive_AddSub_1165_tgt w := by +theorem alive_AddSub_1165 (w : Nat) : alive_AddSub_1165_src w ⊑ alive_AddSub_1165_tgt w := by unfold alive_AddSub_1165_src alive_AddSub_1165_tgt simp_alive_peephole apply bitvec_AddSub_1165 @@ -204,8 +202,8 @@ theorem alive_AddSub_1165 (w : Nat) : alive_AddSub_1165_src w ⊑ alive_AddSub %c = sub %a, %b -/ -def alive_AddSub_1176_src (w : Nat) := -[mlir_icom (w)| { +def alive_AddSub_1176_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v2 = "llvm.sub" (%v1,%b) : (_, _) -> (_) @@ -213,15 +211,15 @@ def alive_AddSub_1176_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def alive_AddSub_1176_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AddSub_1176_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v2 = "llvm.sub" (%v1,%b) : (_, _) -> (_) %v3 = "llvm.sub" (%a,%b) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_AddSub_1176 (w : Nat) : alive_AddSub_1176_src w ⊑ alive_AddSub_1176_tgt w := by +theorem alive_AddSub_1176 (w : Nat) : alive_AddSub_1176_src w ⊑ alive_AddSub_1176_tgt w := by unfold alive_AddSub_1176_src alive_AddSub_1176_tgt simp_alive_peephole apply bitvec_AddSub_1176 @@ -238,8 +236,8 @@ theorem alive_AddSub_1176 (w : Nat) : alive_AddSub_1176_src w ⊑ alive_AddSub %r = sub (C - 1), %x -/ -def alive_AddSub_1202_src (w : Nat) := -[mlir_icom (w)| { +def alive_AddSub_1202_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%x : _, %C : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%x,%v1) : (_, _) -> (_) @@ -247,8 +245,8 @@ def alive_AddSub_1202_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def alive_AddSub_1202_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AddSub_1202_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%x : _, %C : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%x,%v1) : (_, _) -> (_) @@ -257,7 +255,7 @@ def alive_AddSub_1202_tgt (w : Nat):= %v5 = "llvm.sub" (%v4,%x) : (_, _) -> (_) "llvm.return" (%v5) : (_) -> () }] -theorem alive_AddSub_1202 (w : Nat) : alive_AddSub_1202_src w ⊑ alive_AddSub_1202_tgt w := by +theorem alive_AddSub_1202 (w : Nat) : alive_AddSub_1202_src w ⊑ alive_AddSub_1202_tgt w := by unfold alive_AddSub_1202_src alive_AddSub_1202_tgt simp_alive_peephole apply bitvec_AddSub_1202 @@ -276,8 +274,8 @@ theorem alive_AddSub_1202 (w : Nat) : alive_AddSub_1202_src w ⊑ alive_AddSub %c = or %a, %b -/ -def alive_AddSub_1295_src (w : Nat) := -[mlir_icom (w)| { +def alive_AddSub_1295_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) %v2 = "llvm.xor" (%a,%b) : (_, _) -> (_) @@ -285,15 +283,15 @@ def alive_AddSub_1295_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def alive_AddSub_1295_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AddSub_1295_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) %v2 = "llvm.xor" (%a,%b) : (_, _) -> (_) %v3 = "llvm.or" (%a,%b) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_AddSub_1295 (w : Nat) : alive_AddSub_1295_src w ⊑ alive_AddSub_1295_tgt w := by +theorem alive_AddSub_1295 (w : Nat) : alive_AddSub_1295_src w ⊑ alive_AddSub_1295_tgt w := by unfold alive_AddSub_1295_src alive_AddSub_1295_tgt simp_alive_peephole apply bitvec_AddSub_1295 @@ -312,8 +310,8 @@ theorem alive_AddSub_1295 (w : Nat) : alive_AddSub_1295_src w ⊑ alive_AddSub %c = add %a, %b -/ -def alive_AddSub_1309_src (w : Nat) := -[mlir_icom (w)| { +def alive_AddSub_1309_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) %v2 = "llvm.or" (%a,%b) : (_, _) -> (_) @@ -321,15 +319,15 @@ def alive_AddSub_1309_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def alive_AddSub_1309_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AddSub_1309_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) %v2 = "llvm.or" (%a,%b) : (_, _) -> (_) %v3 = "llvm.add" (%a,%b) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_AddSub_1309 (w : Nat) : alive_AddSub_1309_src w ⊑ alive_AddSub_1309_tgt w := by +theorem alive_AddSub_1309 (w : Nat) : alive_AddSub_1309_src w ⊑ alive_AddSub_1309_tgt w := by unfold alive_AddSub_1309_src alive_AddSub_1309_tgt simp_alive_peephole apply bitvec_AddSub_1309 @@ -346,8 +344,8 @@ theorem alive_AddSub_1309 (w : Nat) : alive_AddSub_1309_src w ⊑ alive_AddSub %r = add %x, %a -/ -def alive_AddSub_1539_src (w : Nat) := -[mlir_icom (w)| { +def alive_AddSub_1539_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %x : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v2 = "llvm.sub" (%v1,%a) : (_, _) -> (_) @@ -355,15 +353,15 @@ def alive_AddSub_1539_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def alive_AddSub_1539_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AddSub_1539_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %x : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v2 = "llvm.sub" (%v1,%a) : (_, _) -> (_) %v3 = "llvm.add" (%x,%a) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_AddSub_1539 (w : Nat) : alive_AddSub_1539_src w ⊑ alive_AddSub_1539_tgt w := by +theorem alive_AddSub_1539 (w : Nat) : alive_AddSub_1539_src w ⊑ alive_AddSub_1539_tgt w := by unfold alive_AddSub_1539_src alive_AddSub_1539_tgt simp_alive_peephole apply bitvec_AddSub_1539 @@ -378,21 +376,21 @@ theorem alive_AddSub_1539 (w : Nat) : alive_AddSub_1539_src w ⊑ alive_AddSub %r = add %x, -C -/ -def alive_AddSub_1539_2_src (w : Nat) := -[mlir_icom (w)| { +def alive_AddSub_1539_2_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%x : _, %C : _): %v1 = "llvm.sub" (%x,%C) : (_, _) -> (_) "llvm.return" (%v1) : (_) -> () }] -def alive_AddSub_1539_2_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AddSub_1539_2_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%x : _, %C : _): %v1 = "llvm.neg" (%C) : (_) -> (_) %v2 = "llvm.add" (%x,%v1) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -theorem alive_AddSub_1539_2 (w : Nat) : alive_AddSub_1539_2_src w ⊑ alive_AddSub_1539_2_tgt w := by +theorem alive_AddSub_1539_2 (w : Nat) : alive_AddSub_1539_2_src w ⊑ alive_AddSub_1539_2_tgt w := by unfold alive_AddSub_1539_2_src alive_AddSub_1539_2_tgt simp_alive_peephole apply bitvec_AddSub_1539_2 @@ -407,20 +405,20 @@ theorem alive_AddSub_1539_2 (w : Nat) : alive_AddSub_1539_2_src w ⊑ alive_Ad %r = xor %x, %y -/ -def alive_AddSub_1556_src := +def alive_AddSub_1556_src := [mlir_icom ()| { ^bb0(%y : i1, %x : i1): %v1 = "llvm.sub" (%x,%y) : (i1, i1) -> (i1) "llvm.return" (%v1) : (i1) -> () }] -def alive_AddSub_1556_tgt := +def alive_AddSub_1556_tgt := [mlir_icom ()| { ^bb0(%y : i1, %x : i1): %v1 = "llvm.xor" (%x,%y) : (i1, i1) -> (i1) "llvm.return" (%v1) : (i1) -> () }] -theorem alive_AddSub_1556 : alive_AddSub_1556_src ⊑ alive_AddSub_1556_tgt := by +theorem alive_AddSub_1556 : alive_AddSub_1556_src ⊑ alive_AddSub_1556_tgt := by unfold alive_AddSub_1556_src alive_AddSub_1556_tgt simp_alive_peephole apply bitvec_AddSub_1556 @@ -435,22 +433,22 @@ theorem alive_AddSub_1556 : alive_AddSub_1556_src ⊑ alive_AddSub_1556_tgt := b %r = xor %a, -1 -/ -def alive_AddSub_1560_src (w : Nat) := -[mlir_icom (w)| { +def alive_AddSub_1560_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.sub" (%v1,%a) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -def alive_AddSub_1560_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AddSub_1560_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -theorem alive_AddSub_1560 (w : Nat) : alive_AddSub_1560_src w ⊑ alive_AddSub_1560_tgt w := by +theorem alive_AddSub_1560 (w : Nat) : alive_AddSub_1560_src w ⊑ alive_AddSub_1560_tgt w := by unfold alive_AddSub_1560_src alive_AddSub_1560_tgt simp_alive_peephole apply bitvec_AddSub_1560 @@ -467,8 +465,8 @@ theorem alive_AddSub_1560 (w : Nat) : alive_AddSub_1560_src w ⊑ alive_AddSub %r = add %x, (C + 1) -/ -def alive_AddSub_1564_src (w : Nat) := -[mlir_icom (w)| { +def alive_AddSub_1564_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%x : _, %C : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%x,%v1) : (_, _) -> (_) @@ -476,8 +474,8 @@ def alive_AddSub_1564_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def alive_AddSub_1564_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AddSub_1564_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%x : _, %C : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%x,%v1) : (_, _) -> (_) @@ -486,7 +484,7 @@ def alive_AddSub_1564_tgt (w : Nat):= %v5 = "llvm.add" (%x,%v4) : (_, _) -> (_) "llvm.return" (%v5) : (_) -> () }] -theorem alive_AddSub_1564 (w : Nat) : alive_AddSub_1564_src w ⊑ alive_AddSub_1564_tgt w := by +theorem alive_AddSub_1564 (w : Nat) : alive_AddSub_1564_src w ⊑ alive_AddSub_1564_tgt w := by unfold alive_AddSub_1564_src alive_AddSub_1564_tgt simp_alive_peephole apply bitvec_AddSub_1564 @@ -503,23 +501,23 @@ theorem alive_AddSub_1564 (w : Nat) : alive_AddSub_1564_src w ⊑ alive_AddSub %r = sub (C - C2), %X -/ -def alive_AddSub_1574_src (w : Nat) := -[mlir_icom (w)| { +def alive_AddSub_1574_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%X : _, %C : _, %C2 : _): %v1 = "llvm.add" (%X,%C2) : (_, _) -> (_) %v2 = "llvm.sub" (%C,%v1) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -def alive_AddSub_1574_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AddSub_1574_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%X : _, %C : _, %C2 : _): %v1 = "llvm.add" (%X,%C2) : (_, _) -> (_) %v2 = "llvm.sub" (%C,%C2) : (_, _) -> (_) %v3 = "llvm.sub" (%v2,%X) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_AddSub_1574 (w : Nat) : alive_AddSub_1574_src w ⊑ alive_AddSub_1574_tgt w := by +theorem alive_AddSub_1574 (w : Nat) : alive_AddSub_1574_src w ⊑ alive_AddSub_1574_tgt w := by unfold alive_AddSub_1574_src alive_AddSub_1574_tgt simp_alive_peephole apply bitvec_AddSub_1574 @@ -536,23 +534,23 @@ theorem alive_AddSub_1574 (w : Nat) : alive_AddSub_1574_src w ⊑ alive_AddSub %r = sub 0, %Y -/ -def alive_AddSub_1614_src (w : Nat) := -[mlir_icom (w)| { +def alive_AddSub_1614_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%Y : _, %X : _): %v1 = "llvm.add" (%X,%Y) : (_, _) -> (_) %v2 = "llvm.sub" (%X,%v1) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -def alive_AddSub_1614_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AddSub_1614_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%Y : _, %X : _): %v1 = "llvm.add" (%X,%Y) : (_, _) -> (_) %v2 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v3 = "llvm.sub" (%v2,%Y) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_AddSub_1614 (w : Nat) : alive_AddSub_1614_src w ⊑ alive_AddSub_1614_tgt w := by +theorem alive_AddSub_1614 (w : Nat) : alive_AddSub_1614_src w ⊑ alive_AddSub_1614_tgt w := by unfold alive_AddSub_1614_src alive_AddSub_1614_tgt simp_alive_peephole apply bitvec_AddSub_1614 @@ -569,23 +567,23 @@ theorem alive_AddSub_1614 (w : Nat) : alive_AddSub_1614_src w ⊑ alive_AddSub %r = sub 0, %Y -/ -def alive_AddSub_1619_src (w : Nat) := -[mlir_icom (w)| { +def alive_AddSub_1619_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%Y : _, %X : _): %v1 = "llvm.sub" (%X,%Y) : (_, _) -> (_) %v2 = "llvm.sub" (%v1,%X) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -def alive_AddSub_1619_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AddSub_1619_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%Y : _, %X : _): %v1 = "llvm.sub" (%X,%Y) : (_, _) -> (_) %v2 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v3 = "llvm.sub" (%v2,%Y) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_AddSub_1619 (w : Nat) : alive_AddSub_1619_src w ⊑ alive_AddSub_1619_tgt w := by +theorem alive_AddSub_1619 (w : Nat) : alive_AddSub_1619_src w ⊑ alive_AddSub_1619_tgt w := by unfold alive_AddSub_1619_src alive_AddSub_1619_tgt simp_alive_peephole apply bitvec_AddSub_1619 @@ -604,8 +602,8 @@ theorem alive_AddSub_1619 (w : Nat) : alive_AddSub_1619_src w ⊑ alive_AddSub %r = and %A, %B -/ -def alive_AddSub_1624_src (w : Nat) := -[mlir_icom (w)| { +def alive_AddSub_1624_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.or" (%A,%B) : (_, _) -> (_) %v2 = "llvm.xor" (%A,%B) : (_, _) -> (_) @@ -613,15 +611,15 @@ def alive_AddSub_1624_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def alive_AddSub_1624_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AddSub_1624_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.or" (%A,%B) : (_, _) -> (_) %v2 = "llvm.xor" (%A,%B) : (_, _) -> (_) %v3 = "llvm.and" (%A,%B) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_AddSub_1624 (w : Nat) : alive_AddSub_1624_src w ⊑ alive_AddSub_1624_tgt w := by +theorem alive_AddSub_1624 (w : Nat) : alive_AddSub_1624_src w ⊑ alive_AddSub_1624_tgt w := by unfold alive_AddSub_1624_src alive_AddSub_1624_tgt simp_alive_peephole apply bitvec_AddSub_1624 @@ -639,16 +637,16 @@ theorem alive_AddSub_1624 (w : Nat) : alive_AddSub_1624_src w ⊑ alive_AddSub %r = xor %a, (C1 & C2) -/ -def alive_AndOrXor_135_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_135_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%X : _, %C1 : _, %C2 : _): %v1 = "llvm.xor" (%X,%C1) : (_, _) -> (_) %v2 = "llvm.and" (%v1,%C2) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -def alive_AndOrXor_135_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_135_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%X : _, %C1 : _, %C2 : _): %v1 = "llvm.and" (%X,%C2) : (_, _) -> (_) %v2 = "llvm.xor" (%X,%C1) : (_, _) -> (_) @@ -656,7 +654,7 @@ def alive_AndOrXor_135_tgt (w : Nat):= %v4 = "llvm.xor" (%v1,%v3) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_AndOrXor_135 (w : Nat) : alive_AndOrXor_135_src w ⊑ alive_AndOrXor_135_tgt w := by +theorem alive_AndOrXor_135 (w : Nat) : alive_AndOrXor_135_src w ⊑ alive_AndOrXor_135_tgt w := by unfold alive_AndOrXor_135_src alive_AndOrXor_135_tgt simp_alive_peephole apply bitvec_AndOrXor_135 @@ -674,16 +672,16 @@ theorem alive_AndOrXor_135 (w : Nat) : alive_AndOrXor_135_src w ⊑ alive_AndO %r = and %o, C2 -/ -def alive_AndOrXor_144_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_144_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%X : _, %C1 : _, %C2 : _): %v1 = "llvm.or" (%X,%C1) : (_, _) -> (_) %v2 = "llvm.and" (%v1,%C2) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -def alive_AndOrXor_144_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_144_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%X : _, %C1 : _, %C2 : _): %v1 = "llvm.and" (%C1,%C2) : (_, _) -> (_) %v2 = "llvm.or" (%X,%v1) : (_, _) -> (_) @@ -691,7 +689,7 @@ def alive_AndOrXor_144_tgt (w : Nat):= %v4 = "llvm.and" (%v2,%C2) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_AndOrXor_144 (w : Nat) : alive_AndOrXor_144_src w ⊑ alive_AndOrXor_144_tgt w := by +theorem alive_AndOrXor_144 (w : Nat) : alive_AndOrXor_144_src w ⊑ alive_AndOrXor_144_tgt w := by unfold alive_AndOrXor_144_src alive_AndOrXor_144_tgt simp_alive_peephole apply bitvec_AndOrXor_144 @@ -716,35 +714,35 @@ theorem alive_AndOrXor_144 (w : Nat) : alive_AndOrXor_144_src w ⊑ alive_AndO %r = icmp eq %a3, 0 -/ -def alive_AndOrXor_698_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_698_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _, %d : _): - %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) - %v2 = "llvm.and" (%a,%d) : (_, _) -> (_) + %v1 = "llvm.and" (%a,%b) : (_, _) -> (i1) + %v2 = "llvm.and" (%a,%d) : (_, _) -> (i1) %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v4 = "llvm.icmp.eq" (%v1,%v3) : (_, _) -> (_) + %v4 = "llvm.icmp.eq" (%v1,%v3) : (_, _) -> (i1) %v5 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v6 = "llvm.icmp.eq" (%v2,%v5) : (_, _) -> (_) - %v7 = "llvm.and" (%v4,%v6) : (_, _) -> (i1) + %v6 = "llvm.icmp.eq" (%v2,%v5) : (_, _) -> (i1) + %v7 = "llvm.and" (%v4,%v6) : (i1, i1) -> (i1) "llvm.return" (%v7) : (i1) -> () }] -def alive_AndOrXor_698_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_698_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _, %d : _): - %v1 = "llvm.or" (%b,%d) : (_, _) -> (_) - %v2 = "llvm.and" (%a,%v1) : (_, _) -> (_) + %v1 = "llvm.or" (%b,%d) : (_, _) -> (i1) + %v2 = "llvm.and" (%a,%v1) : (_, _) -> (i1) %v3 = "llvm.and" (%a,%b) : (_, _) -> (_) %v4 = "llvm.and" (%a,%d) : (_, _) -> (_) %v5 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v6 = "llvm.icmp.eq" (%v3,%v5) : (_, _) -> (_) + %v6 = "llvm.icmp.eq" (%v3,%v5) : (_, _) -> (i1) %v7 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v8 = "llvm.icmp.eq" (%v4,%v7) : (_, _) -> (_) + %v8 = "llvm.icmp.eq" (%v4,%v7) : (_, _) -> (i1) %v9 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v10 = "llvm.icmp.eq" (%v2,%v9) : (_, _) -> (_) + %v10 = "llvm.icmp.eq" (%v2,%v9) : (_, _) -> (i1) "llvm.return" (%v10) : (i1) -> () }] -theorem alive_AndOrXor_698 : alive_AndOrXor_698_src ⊑ alive_AndOrXor_698_tgt := by +theorem alive_AndOrXor_698 (w : Nat) : alive_AndOrXor_698_src w ⊑ alive_AndOrXor_698_tgt w := by unfold alive_AndOrXor_698_src alive_AndOrXor_698_tgt simp_alive_peephole apply bitvec_AndOrXor_698 @@ -769,30 +767,30 @@ theorem alive_AndOrXor_698 : alive_AndOrXor_698_src ⊑ alive_AndOrXor_698_tgt : %r = icmp eq %a3, %or -/ -def alive_AndOrXor_709_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_709_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _, %d : _): - %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) - %v2 = "llvm.and" (%a,%d) : (_, _) -> (_) - %v3 = "llvm.icmp.eq" (%v1,%b) : (_, _) -> (_) - %v4 = "llvm.icmp.eq" (%v2,%d) : (_, _) -> (_) - %v5 = "llvm.and" (%v3,%v4) : (_, _) -> (i1) + %v1 = "llvm.and" (%a,%b) : (_, _) -> (i1) + %v2 = "llvm.and" (%a,%d) : (_, _) -> (i1) + %v3 = "llvm.icmp.eq" (%v1,%b) : (_, _) -> (i1) + %v4 = "llvm.icmp.eq" (%v2,%d) : (_, _) -> (i1) + %v5 = "llvm.and" (%v3,%v4) : (i1, i1) -> (i1) "llvm.return" (%v5) : (i1) -> () }] -def alive_AndOrXor_709_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_709_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _, %d : _): - %v1 = "llvm.or" (%b,%d) : (_, _) -> (_) - %v2 = "llvm.and" (%a,%v1) : (_, _) -> (_) + %v1 = "llvm.or" (%b,%d) : (_, _) -> (i1) + %v2 = "llvm.and" (%a,%v1) : (_, _) -> (i1) %v3 = "llvm.and" (%a,%b) : (_, _) -> (_) %v4 = "llvm.and" (%a,%d) : (_, _) -> (_) - %v5 = "llvm.icmp.eq" (%v3,%b) : (_, _) -> (_) - %v6 = "llvm.icmp.eq" (%v4,%d) : (_, _) -> (_) - %v7 = "llvm.icmp.eq" (%v2,%v1) : (_, _) -> (_) + %v5 = "llvm.icmp.eq" (%v3,%b) : (_, _) -> (i1) + %v6 = "llvm.icmp.eq" (%v4,%d) : (_, _) -> (i1) + %v7 = "llvm.icmp.eq" (%v2,%v1) : (_, _) -> (i1) "llvm.return" (%v7) : (i1) -> () }] -theorem alive_AndOrXor_709 : alive_AndOrXor_709_src ⊑ alive_AndOrXor_709_tgt := by +theorem alive_AndOrXor_709 (w : Nat) : alive_AndOrXor_709_src w ⊑ alive_AndOrXor_709_tgt w := by unfold alive_AndOrXor_709_src alive_AndOrXor_709_tgt simp_alive_peephole apply bitvec_AndOrXor_709 @@ -817,30 +815,30 @@ theorem alive_AndOrXor_709 : alive_AndOrXor_709_src ⊑ alive_AndOrXor_709_tgt : %r = icmp eq %a3, %a -/ -def alive_AndOrXor_716_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_716_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _, %d : _): - %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) - %v2 = "llvm.and" (%a,%d) : (_, _) -> (_) - %v3 = "llvm.icmp.eq" (%v1,%a) : (_, _) -> (_) - %v4 = "llvm.icmp.eq" (%v2,%a) : (_, _) -> (_) - %v5 = "llvm.and" (%v3,%v4) : (_, _) -> (i1) + %v1 = "llvm.and" (%a,%b) : (_, _) -> (i1) + %v2 = "llvm.and" (%a,%d) : (_, _) -> (i1) + %v3 = "llvm.icmp.eq" (%v1,%a) : (_, _) -> (i1) + %v4 = "llvm.icmp.eq" (%v2,%a) : (_, _) -> (i1) + %v5 = "llvm.and" (%v3,%v4) : (i1, i1) -> (i1) "llvm.return" (%v5) : (i1) -> () }] -def alive_AndOrXor_716_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_716_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _, %d : _): - %v1 = "llvm.and" (%b,%d) : (_, _) -> (_) - %v2 = "llvm.and" (%a,%v1) : (_, _) -> (_) + %v1 = "llvm.and" (%b,%d) : (_, _) -> (i1) + %v2 = "llvm.and" (%a,%v1) : (_, _) -> (i1) %v3 = "llvm.and" (%a,%b) : (_, _) -> (_) %v4 = "llvm.and" (%a,%d) : (_, _) -> (_) - %v5 = "llvm.icmp.eq" (%v3,%a) : (_, _) -> (_) - %v6 = "llvm.icmp.eq" (%v4,%a) : (_, _) -> (_) - %v7 = "llvm.icmp.eq" (%v2,%a) : (_, _) -> (_) + %v5 = "llvm.icmp.eq" (%v3,%a) : (_, _) -> (i1) + %v6 = "llvm.icmp.eq" (%v4,%a) : (_, _) -> (i1) + %v7 = "llvm.icmp.eq" (%v2,%a) : (_, _) -> (i1) "llvm.return" (%v7) : (i1) -> () }] -theorem alive_AndOrXor_716 : alive_AndOrXor_716_src ⊑ alive_AndOrXor_716_tgt := by +theorem alive_AndOrXor_716 (w : Nat) : alive_AndOrXor_716_src w ⊑ alive_AndOrXor_716_tgt w := by unfold alive_AndOrXor_716_src alive_AndOrXor_716_tgt simp_alive_peephole apply bitvec_AndOrXor_716 @@ -859,24 +857,24 @@ theorem alive_AndOrXor_716 : alive_AndOrXor_716_src ⊑ alive_AndOrXor_716_tgt : %r = icmp sgt %a, %b -/ -def alive_AndOrXor_794_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_794_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): - %v1 = "llvm.icmp.sgt" (%a,%b) : (_, _) -> (_) - %v2 = "llvm.icmp.ne" (%a,%b) : (_, _) -> (_) - %v3 = "llvm.and" (%v1,%v2) : (_, _) -> (i1) + %v1 = "llvm.icmp.sgt" (%a,%b) : (_, _) -> (i1) + %v2 = "llvm.icmp.ne" (%a,%b) : (_, _) -> (i1) + %v3 = "llvm.and" (%v1,%v2) : (i1, i1) -> (i1) "llvm.return" (%v3) : (i1) -> () }] -def alive_AndOrXor_794_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_794_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): - %v1 = "llvm.icmp.sgt" (%a,%b) : (_, _) -> (_) - %v2 = "llvm.icmp.ne" (%a,%b) : (_, _) -> (_) - %v3 = "llvm.icmp.sgt" (%a,%b) : (_, _) -> (_) + %v1 = "llvm.icmp.sgt" (%a,%b) : (_, _) -> (i1) + %v2 = "llvm.icmp.ne" (%a,%b) : (_, _) -> (i1) + %v3 = "llvm.icmp.sgt" (%a,%b) : (_, _) -> (i1) "llvm.return" (%v3) : (i1) -> () }] -theorem alive_AndOrXor_794 : alive_AndOrXor_794_src ⊑ alive_AndOrXor_794_tgt := by +theorem alive_AndOrXor_794 (w : Nat) : alive_AndOrXor_794_src w ⊑ alive_AndOrXor_794_tgt w := by unfold alive_AndOrXor_794_src alive_AndOrXor_794_tgt simp_alive_peephole apply bitvec_AndOrXor_794 @@ -896,30 +894,30 @@ theorem alive_AndOrXor_794 : alive_AndOrXor_794_src ⊑ alive_AndOrXor_794_tgt : %r = icmp eq %o, 0 -/ -def alive_AndOrXor_827_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_827_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v2 = "llvm.icmp.eq" (%a,%v1) : (_, _) -> (_) + %v2 = "llvm.icmp.eq" (%a,%v1) : (_, _) -> (i1) %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v4 = "llvm.icmp.eq" (%b,%v3) : (_, _) -> (_) - %v5 = "llvm.and" (%v2,%v4) : (_, _) -> (i1) + %v4 = "llvm.icmp.eq" (%b,%v3) : (_, _) -> (i1) + %v5 = "llvm.and" (%v2,%v4) : (i1, i1) -> (i1) "llvm.return" (%v5) : (i1) -> () }] -def alive_AndOrXor_827_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_827_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): - %v1 = "llvm.or" (%a,%b) : (_, _) -> (_) + %v1 = "llvm.or" (%a,%b) : (_, _) -> (i1) %v2 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v3 = "llvm.icmp.eq" (%a,%v2) : (_, _) -> (_) + %v3 = "llvm.icmp.eq" (%a,%v2) : (_, _) -> (i1) %v4 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v5 = "llvm.icmp.eq" (%b,%v4) : (_, _) -> (_) + %v5 = "llvm.icmp.eq" (%b,%v4) : (_, _) -> (i1) %v6 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v7 = "llvm.icmp.eq" (%v1,%v6) : (_, _) -> (_) + %v7 = "llvm.icmp.eq" (%v1,%v6) : (_, _) -> (i1) "llvm.return" (%v7) : (i1) -> () }] -theorem alive_AndOrXor_827 : alive_AndOrXor_827_src ⊑ alive_AndOrXor_827_tgt := by +theorem alive_AndOrXor_827 (w : Nat) : alive_AndOrXor_827_src w ⊑ alive_AndOrXor_827_tgt w := by unfold alive_AndOrXor_827_src alive_AndOrXor_827_tgt simp_alive_peephole apply bitvec_AndOrXor_827 @@ -938,25 +936,25 @@ theorem alive_AndOrXor_827 : alive_AndOrXor_827_src ⊑ alive_AndOrXor_827_tgt : %r = false -/ -def alive_AndOrXor_887_2_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_887_2_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %C1 : _): - %v1 = "llvm.icmp.eq" (%a,%C1) : (_, _) -> (_) - %v2 = "llvm.icmp.ne" (%a,%C1) : (_, _) -> (_) - %v3 = "llvm.and" (%v1,%v2) : (_, _) -> (i1) + %v1 = "llvm.icmp.eq" (%a,%C1) : (_, _) -> (i1) + %v2 = "llvm.icmp.ne" (%a,%C1) : (_, _) -> (i1) + %v3 = "llvm.and" (%v1,%v2) : (i1, i1) -> (i1) "llvm.return" (%v3) : (i1) -> () }] -def alive_AndOrXor_887_2_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_887_2_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %C1 : _): - %v1 = "llvm.icmp.eq" (%a,%C1) : (_, _) -> (_) - %v2 = "llvm.icmp.ne" (%a,%C1) : (_, _) -> (_) - %v3 = "llvm.mlir.constant" () { value = 0 : 1 } :() -> (i1) + %v1 = "llvm.icmp.eq" (%a,%C1) : (_, _) -> (i1) + %v2 = "llvm.icmp.ne" (%a,%C1) : (_, _) -> (i1) + %v3 = "llvm.mlir.constant" () { value = 0 : i1 } :() -> (i1) %v4 = "llvm.copy" (%v3) : (i1) -> (i1) "llvm.return" (%v4) : (i1) -> () }] -theorem alive_AndOrXor_887_2 : alive_AndOrXor_887_2_src ⊑ alive_AndOrXor_887_2_tgt := by +theorem alive_AndOrXor_887_2 (w : Nat) : alive_AndOrXor_887_2_src w ⊑ alive_AndOrXor_887_2_tgt w := by unfold alive_AndOrXor_887_2_src alive_AndOrXor_887_2_tgt simp_alive_peephole apply bitvec_AndOrXor_887_2 @@ -976,8 +974,8 @@ theorem alive_AndOrXor_887_2 : alive_AndOrXor_887_2_src ⊑ alive_AndOrXor_887_2 %r = xor %or, -1 -/ -def alive_AndOrXor_1230__A__B___A__B_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_1230__A__B___A__B_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%notOp0 : _, %notOp1 : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%notOp0,%v1) : (_, _) -> (_) @@ -987,8 +985,8 @@ def alive_AndOrXor_1230__A__B___A__B_src (w : Nat) := "llvm.return" (%v5) : (_) -> () }] -def alive_AndOrXor_1230__A__B___A__B_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_1230__A__B___A__B_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%notOp0 : _, %notOp1 : _): %v1 = "llvm.or" (%notOp0,%notOp1) : (_, _) -> (_) %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -999,7 +997,7 @@ def alive_AndOrXor_1230__A__B___A__B_tgt (w : Nat):= %v7 = "llvm.xor" (%v1,%v6) : (_, _) -> (_) "llvm.return" (%v7) : (_) -> () }] -theorem alive_AndOrXor_1230__A__B___A__B (w : Nat) : alive_AndOrXor_1230__A__B___A__B_src w ⊑ alive_AndOrXor_1230__A__B___A__B_tgt w := by +theorem alive_AndOrXor_1230__A__B___A__B (w : Nat) : alive_AndOrXor_1230__A__B___A__B_src w ⊑ alive_AndOrXor_1230__A__B___A__B_tgt w := by unfold alive_AndOrXor_1230__A__B___A__B_src alive_AndOrXor_1230__A__B___A__B_tgt simp_alive_peephole apply bitvec_AndOrXor_1230__A__B___A__B @@ -1020,8 +1018,8 @@ theorem alive_AndOrXor_1230__A__B___A__B (w : Nat) : alive_AndOrXor_1230__A__B_ %r = xor %A, %B -/ -def alive_AndOrXor_1241_AB__AB__AB_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_1241_AB__AB__AB_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.or" (%A,%B) : (_, _) -> (_) %v2 = "llvm.and" (%A,%B) : (_, _) -> (_) @@ -1031,8 +1029,8 @@ def alive_AndOrXor_1241_AB__AB__AB_src (w : Nat) := "llvm.return" (%v5) : (_) -> () }] -def alive_AndOrXor_1241_AB__AB__AB_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_1241_AB__AB__AB_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.or" (%A,%B) : (_, _) -> (_) %v2 = "llvm.and" (%A,%B) : (_, _) -> (_) @@ -1041,7 +1039,7 @@ def alive_AndOrXor_1241_AB__AB__AB_tgt (w : Nat):= %v5 = "llvm.xor" (%A,%B) : (_, _) -> (_) "llvm.return" (%v5) : (_) -> () }] -theorem alive_AndOrXor_1241_AB__AB__AB (w : Nat) : alive_AndOrXor_1241_AB__AB__AB_src w ⊑ alive_AndOrXor_1241_AB__AB__AB_tgt w := by +theorem alive_AndOrXor_1241_AB__AB__AB (w : Nat) : alive_AndOrXor_1241_AB__AB__AB_src w ⊑ alive_AndOrXor_1241_AB__AB__AB_tgt w := by unfold alive_AndOrXor_1241_AB__AB__AB_src alive_AndOrXor_1241_AB__AB__AB_tgt simp_alive_peephole apply bitvec_AndOrXor_1241_AB__AB__AB @@ -1062,8 +1060,8 @@ theorem alive_AndOrXor_1241_AB__AB__AB (w : Nat) : alive_AndOrXor_1241_AB__AB__ %r = xor %A, %B -/ -def alive_AndOrXor_1247_AB__AB__AB_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_1247_AB__AB__AB_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.and" (%A,%B) : (_, _) -> (_) %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -1073,8 +1071,8 @@ def alive_AndOrXor_1247_AB__AB__AB_src (w : Nat) := "llvm.return" (%v5) : (_) -> () }] -def alive_AndOrXor_1247_AB__AB__AB_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_1247_AB__AB__AB_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.and" (%A,%B) : (_, _) -> (_) %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -1083,7 +1081,7 @@ def alive_AndOrXor_1247_AB__AB__AB_tgt (w : Nat):= %v5 = "llvm.xor" (%A,%B) : (_, _) -> (_) "llvm.return" (%v5) : (_) -> () }] -theorem alive_AndOrXor_1247_AB__AB__AB (w : Nat) : alive_AndOrXor_1247_AB__AB__AB_src w ⊑ alive_AndOrXor_1247_AB__AB__AB_tgt w := by +theorem alive_AndOrXor_1247_AB__AB__AB (w : Nat) : alive_AndOrXor_1247_AB__AB__AB_src w ⊑ alive_AndOrXor_1247_AB__AB__AB_tgt w := by unfold alive_AndOrXor_1247_AB__AB__AB_src alive_AndOrXor_1247_AB__AB__AB_tgt simp_alive_peephole apply bitvec_AndOrXor_1247_AB__AB__AB @@ -1101,16 +1099,16 @@ theorem alive_AndOrXor_1247_AB__AB__AB (w : Nat) : alive_AndOrXor_1247_AB__AB__ %r = and %A, %notB -/ -def alive_AndOrXor_1253_A__AB___A__B_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_1253_A__AB___A__B_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.xor" (%A,%B) : (_, _) -> (_) %v2 = "llvm.and" (%v1,%A) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -def alive_AndOrXor_1253_A__AB___A__B_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_1253_A__AB___A__B_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%B,%v1) : (_, _) -> (_) @@ -1118,7 +1116,7 @@ def alive_AndOrXor_1253_A__AB___A__B_tgt (w : Nat):= %v4 = "llvm.and" (%A,%v2) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_AndOrXor_1253_A__AB___A__B (w : Nat) : alive_AndOrXor_1253_A__AB___A__B_src w ⊑ alive_AndOrXor_1253_A__AB___A__B_tgt w := by +theorem alive_AndOrXor_1253_A__AB___A__B (w : Nat) : alive_AndOrXor_1253_A__AB___A__B_src w ⊑ alive_AndOrXor_1253_A__AB___A__B_tgt w := by unfold alive_AndOrXor_1253_A__AB___A__B_src alive_AndOrXor_1253_A__AB___A__B_tgt simp_alive_peephole apply bitvec_AndOrXor_1253_A__AB___A__B @@ -1137,8 +1135,8 @@ theorem alive_AndOrXor_1253_A__AB___A__B (w : Nat) : alive_AndOrXor_1253_A__AB_ %r = and %A, %B -/ -def alive_AndOrXor_1280_ABA___AB_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_1280_ABA___AB_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%A,%v1) : (_, _) -> (_) @@ -1147,8 +1145,8 @@ def alive_AndOrXor_1280_ABA___AB_src (w : Nat) := "llvm.return" (%v4) : (_) -> () }] -def alive_AndOrXor_1280_ABA___AB_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_1280_ABA___AB_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%A,%v1) : (_, _) -> (_) @@ -1156,7 +1154,7 @@ def alive_AndOrXor_1280_ABA___AB_tgt (w : Nat):= %v4 = "llvm.and" (%A,%B) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_AndOrXor_1280_ABA___AB (w : Nat) : alive_AndOrXor_1280_ABA___AB_src w ⊑ alive_AndOrXor_1280_ABA___AB_tgt w := by +theorem alive_AndOrXor_1280_ABA___AB (w : Nat) : alive_AndOrXor_1280_ABA___AB_src w ⊑ alive_AndOrXor_1280_ABA___AB_tgt w := by unfold alive_AndOrXor_1280_ABA___AB_src alive_AndOrXor_1280_ABA___AB_tgt simp_alive_peephole apply bitvec_AndOrXor_1280_ABA___AB @@ -1178,8 +1176,8 @@ theorem alive_AndOrXor_1280_ABA___AB (w : Nat) : alive_AndOrXor_1280_ABA___AB_s %r = and %op0, %negC -/ -def alive_AndOrXor_1288_A__B__B__C__A___A__B__C_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_1288_A__B__B__C__A___A__B__C_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %C : _, %B : _): %v1 = "llvm.xor" (%A,%B) : (_, _) -> (_) %v2 = "llvm.xor" (%B,%C) : (_, _) -> (_) @@ -1188,8 +1186,8 @@ def alive_AndOrXor_1288_A__B__B__C__A___A__B__C_src (w : Nat) := "llvm.return" (%v4) : (_) -> () }] -def alive_AndOrXor_1288_A__B__B__C__A___A__B__C_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_1288_A__B__B__C__A___A__B__C_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %C : _, %B : _): %v1 = "llvm.xor" (%A,%B) : (_, _) -> (_) %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -1199,7 +1197,7 @@ def alive_AndOrXor_1288_A__B__B__C__A___A__B__C_tgt (w : Nat):= %v6 = "llvm.and" (%v1,%v3) : (_, _) -> (_) "llvm.return" (%v6) : (_) -> () }] -theorem alive_AndOrXor_1288_A__B__B__C__A___A__B__C (w : Nat) : alive_AndOrXor_1288_A__B__B__C__A___A__B__C_src w ⊑ alive_AndOrXor_1288_A__B__B__C__A___A__B__C_tgt w := by +theorem alive_AndOrXor_1288_A__B__B__C__A___A__B__C (w : Nat) : alive_AndOrXor_1288_A__B__B__C__A___A__B__C_src w ⊑ alive_AndOrXor_1288_A__B__B__C__A___A__B__C_tgt w := by unfold alive_AndOrXor_1288_A__B__B__C__A___A__B__C_src alive_AndOrXor_1288_A__B__B__C__A___A__B__C_tgt simp_alive_peephole apply bitvec_AndOrXor_1288_A__B__B__C__A___A__B__C @@ -1220,8 +1218,8 @@ theorem alive_AndOrXor_1288_A__B__B__C__A___A__B__C (w : Nat) : alive_AndOrXor_ %r = and %A, %B -/ -def alive_AndOrXor_1294_A__B__A__B___A__B_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_1294_A__B__A__B___A__B_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.or" (%A,%B) : (_, _) -> (_) %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -1231,8 +1229,8 @@ def alive_AndOrXor_1294_A__B__A__B___A__B_src (w : Nat) := "llvm.return" (%v5) : (_) -> () }] -def alive_AndOrXor_1294_A__B__A__B___A__B_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_1294_A__B__A__B___A__B_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.or" (%A,%B) : (_, _) -> (_) %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -1241,7 +1239,7 @@ def alive_AndOrXor_1294_A__B__A__B___A__B_tgt (w : Nat):= %v5 = "llvm.and" (%A,%B) : (_, _) -> (_) "llvm.return" (%v5) : (_) -> () }] -theorem alive_AndOrXor_1294_A__B__A__B___A__B (w : Nat) : alive_AndOrXor_1294_A__B__A__B___A__B_src w ⊑ alive_AndOrXor_1294_A__B__A__B___A__B_tgt w := by +theorem alive_AndOrXor_1294_A__B__A__B___A__B (w : Nat) : alive_AndOrXor_1294_A__B__A__B___A__B_src w ⊑ alive_AndOrXor_1294_A__B__A__B___A__B_tgt w := by unfold alive_AndOrXor_1294_A__B__A__B___A__B_src alive_AndOrXor_1294_A__B__A__B___A__B_tgt simp_alive_peephole apply bitvec_AndOrXor_1294_A__B__A__B___A__B @@ -1260,24 +1258,24 @@ theorem alive_AndOrXor_1294_A__B__A__B___A__B (w : Nat) : alive_AndOrXor_1294_A %r = icmp uge %a, %b -/ -def alive_AndOrXor_1683_1_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_1683_1_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): - %v1 = "llvm.icmp.ugt" (%a,%b) : (_, _) -> (_) - %v2 = "llvm.icmp.eq" (%a,%b) : (_, _) -> (_) - %v3 = "llvm.or" (%v1,%v2) : (_, _) -> (i1) + %v1 = "llvm.icmp.ugt" (%a,%b) : (_, _) -> (i1) + %v2 = "llvm.icmp.eq" (%a,%b) : (_, _) -> (i1) + %v3 = "llvm.or" (%v1,%v2) : (i1, i1) -> (i1) "llvm.return" (%v3) : (i1) -> () }] -def alive_AndOrXor_1683_1_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_1683_1_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): - %v1 = "llvm.icmp.ugt" (%a,%b) : (_, _) -> (_) - %v2 = "llvm.icmp.eq" (%a,%b) : (_, _) -> (_) - %v3 = "llvm.icmp.uge" (%a,%b) : (_, _) -> (_) + %v1 = "llvm.icmp.ugt" (%a,%b) : (_, _) -> (i1) + %v2 = "llvm.icmp.eq" (%a,%b) : (_, _) -> (i1) + %v3 = "llvm.icmp.uge" (%a,%b) : (_, _) -> (i1) "llvm.return" (%v3) : (i1) -> () }] -theorem alive_AndOrXor_1683_1 : alive_AndOrXor_1683_1_src ⊑ alive_AndOrXor_1683_1_tgt := by +theorem alive_AndOrXor_1683_1 (w : Nat) : alive_AndOrXor_1683_1_src w ⊑ alive_AndOrXor_1683_1_tgt w := by unfold alive_AndOrXor_1683_1_src alive_AndOrXor_1683_1_tgt simp_alive_peephole apply bitvec_AndOrXor_1683_1 @@ -1296,25 +1294,25 @@ theorem alive_AndOrXor_1683_1 : alive_AndOrXor_1683_1_src ⊑ alive_AndOrXor_168 %r = true -/ -def alive_AndOrXor_1683_2_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_1683_2_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): - %v1 = "llvm.icmp.uge" (%a,%b) : (_, _) -> (_) - %v2 = "llvm.icmp.ne" (%a,%b) : (_, _) -> (_) - %v3 = "llvm.or" (%v1,%v2) : (_, _) -> (i1) + %v1 = "llvm.icmp.uge" (%a,%b) : (_, _) -> (i1) + %v2 = "llvm.icmp.ne" (%a,%b) : (_, _) -> (i1) + %v3 = "llvm.or" (%v1,%v2) : (i1, i1) -> (i1) "llvm.return" (%v3) : (i1) -> () }] -def alive_AndOrXor_1683_2_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_1683_2_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): - %v1 = "llvm.icmp.uge" (%a,%b) : (_, _) -> (_) - %v2 = "llvm.icmp.ne" (%a,%b) : (_, _) -> (_) + %v1 = "llvm.icmp.uge" (%a,%b) : (_, _) -> (i1) + %v2 = "llvm.icmp.ne" (%a,%b) : (_, _) -> (i1) %v3 = "llvm.mlir.constant" () { value = 1 : 1 } :() -> (i1) %v4 = "llvm.copy" (%v3) : (i1) -> (i1) "llvm.return" (%v4) : (i1) -> () }] -theorem alive_AndOrXor_1683_2 : alive_AndOrXor_1683_2_src ⊑ alive_AndOrXor_1683_2_tgt := by +theorem alive_AndOrXor_1683_2 (w : Nat) : alive_AndOrXor_1683_2_src w ⊑ alive_AndOrXor_1683_2_tgt w := by unfold alive_AndOrXor_1683_2_src alive_AndOrXor_1683_2_tgt simp_alive_peephole apply bitvec_AndOrXor_1683_2 @@ -1334,28 +1332,28 @@ theorem alive_AndOrXor_1683_2 : alive_AndOrXor_1683_2_src ⊑ alive_AndOrXor_168 %r = icmp uge %b1, %A -/ -def alive_AndOrXor_1704_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_1704_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v2 = "llvm.icmp.eq" (%B,%v1) : (_, _) -> (_) - %v3 = "llvm.icmp.ult" (%A,%B) : (_, _) -> (_) - %v4 = "llvm.or" (%v2,%v3) : (_, _) -> (i1) + %v2 = "llvm.icmp.eq" (%B,%v1) : (_, _) -> (i1) + %v3 = "llvm.icmp.ult" (%A,%B) : (_, _) -> (i1) + %v4 = "llvm.or" (%v2,%v3) : (i1, i1) -> (i1) "llvm.return" (%v4) : (i1) -> () }] -def alive_AndOrXor_1704_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_1704_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) - %v2 = "llvm.add" (%B,%v1) : (_, _) -> (_) + %v2 = "llvm.add" (%B,%v1) : (_, _) -> (i1) %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v4 = "llvm.icmp.eq" (%B,%v3) : (_, _) -> (_) - %v5 = "llvm.icmp.ult" (%A,%B) : (_, _) -> (_) - %v6 = "llvm.icmp.uge" (%v2,%A) : (_, _) -> (_) + %v4 = "llvm.icmp.eq" (%B,%v3) : (_, _) -> (i1) + %v5 = "llvm.icmp.ult" (%A,%B) : (_, _) -> (i1) + %v6 = "llvm.icmp.uge" (%v2,%A) : (_, _) -> (i1) "llvm.return" (%v6) : (i1) -> () }] -theorem alive_AndOrXor_1704 : alive_AndOrXor_1704_src ⊑ alive_AndOrXor_1704_tgt := by +theorem alive_AndOrXor_1704 (w : Nat) : alive_AndOrXor_1704_src w ⊑ alive_AndOrXor_1704_tgt w := by unfold alive_AndOrXor_1704_src alive_AndOrXor_1704_tgt simp_alive_peephole apply bitvec_AndOrXor_1704 @@ -1375,28 +1373,28 @@ theorem alive_AndOrXor_1704 : alive_AndOrXor_1704_src ⊑ alive_AndOrXor_1704_tg %r = icmp uge %b1, %A -/ -def alive_AndOrXor_1705_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_1705_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v2 = "llvm.icmp.eq" (%B,%v1) : (_, _) -> (_) - %v3 = "llvm.icmp.ugt" (%B,%A) : (_, _) -> (_) - %v4 = "llvm.or" (%v2,%v3) : (_, _) -> (i1) + %v2 = "llvm.icmp.eq" (%B,%v1) : (_, _) -> (i1) + %v3 = "llvm.icmp.ugt" (%B,%A) : (_, _) -> (i1) + %v4 = "llvm.or" (%v2,%v3) : (i1, i1) -> (i1) "llvm.return" (%v4) : (i1) -> () }] -def alive_AndOrXor_1705_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_1705_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) - %v2 = "llvm.add" (%B,%v1) : (_, _) -> (_) + %v2 = "llvm.add" (%B,%v1) : (_, _) -> (i1) %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v4 = "llvm.icmp.eq" (%B,%v3) : (_, _) -> (_) - %v5 = "llvm.icmp.ugt" (%B,%A) : (_, _) -> (_) - %v6 = "llvm.icmp.uge" (%v2,%A) : (_, _) -> (_) + %v4 = "llvm.icmp.eq" (%B,%v3) : (_, _) -> (i1) + %v5 = "llvm.icmp.ugt" (%B,%A) : (_, _) -> (i1) + %v6 = "llvm.icmp.uge" (%v2,%A) : (_, _) -> (i1) "llvm.return" (%v6) : (i1) -> () }] -theorem alive_AndOrXor_1705 : alive_AndOrXor_1705_src ⊑ alive_AndOrXor_1705_tgt := by +theorem alive_AndOrXor_1705 (w : Nat) : alive_AndOrXor_1705_src w ⊑ alive_AndOrXor_1705_tgt w := by unfold alive_AndOrXor_1705_src alive_AndOrXor_1705_tgt simp_alive_peephole apply bitvec_AndOrXor_1705 @@ -1416,30 +1414,30 @@ theorem alive_AndOrXor_1705 : alive_AndOrXor_1705_src ⊑ alive_AndOrXor_1705_tg %r = icmp ne %or, 0 -/ -def alive_AndOrXor_1733_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_1733_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v2 = "llvm.icmp.ne" (%A,%v1) : (_, _) -> (_) + %v2 = "llvm.icmp.ne" (%A,%v1) : (_, _) -> (i1) %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v4 = "llvm.icmp.ne" (%B,%v3) : (_, _) -> (_) - %v5 = "llvm.or" (%v2,%v4) : (_, _) -> (i1) + %v4 = "llvm.icmp.ne" (%B,%v3) : (_, _) -> (i1) + %v5 = "llvm.or" (%v2,%v4) : (i1, i1) -> (i1) "llvm.return" (%v5) : (i1) -> () }] -def alive_AndOrXor_1733_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_1733_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): - %v1 = "llvm.or" (%A,%B) : (_, _) -> (_) + %v1 = "llvm.or" (%A,%B) : (_, _) -> (i1) %v2 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v3 = "llvm.icmp.ne" (%A,%v2) : (_, _) -> (_) + %v3 = "llvm.icmp.ne" (%A,%v2) : (_, _) -> (i1) %v4 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v5 = "llvm.icmp.ne" (%B,%v4) : (_, _) -> (_) + %v5 = "llvm.icmp.ne" (%B,%v4) : (_, _) -> (i1) %v6 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v7 = "llvm.icmp.ne" (%v1,%v6) : (_, _) -> (_) + %v7 = "llvm.icmp.ne" (%v1,%v6) : (_, _) -> (i1) "llvm.return" (%v7) : (i1) -> () }] -theorem alive_AndOrXor_1733 : alive_AndOrXor_1733_src ⊑ alive_AndOrXor_1733_tgt := by +theorem alive_AndOrXor_1733 (w : Nat) : alive_AndOrXor_1733_src w ⊑ alive_AndOrXor_1733_tgt w := by unfold alive_AndOrXor_1733_src alive_AndOrXor_1733_tgt simp_alive_peephole apply bitvec_AndOrXor_1733 @@ -1457,16 +1455,16 @@ theorem alive_AndOrXor_1733 : alive_AndOrXor_1733_src ⊑ alive_AndOrXor_1733_tg %r = xor %or, (C1 & ~C) -/ -def alive_AndOrXor_2063__X__C1__C2____X__C2__C1__C2_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2063__X__C1__C2____X__C2__C1__C2_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%x : _, %C1 : _, %C : _): %v1 = "llvm.xor" (%x,%C1) : (_, _) -> (_) %v2 = "llvm.or" (%v1,%C) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -def alive_AndOrXor_2063__X__C1__C2____X__C2__C1__C2_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2063__X__C1__C2____X__C2__C1__C2_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%x : _, %C1 : _, %C : _): %v1 = "llvm.or" (%x,%C) : (_, _) -> (_) %v2 = "llvm.xor" (%x,%C1) : (_, _) -> (_) @@ -1475,7 +1473,7 @@ def alive_AndOrXor_2063__X__C1__C2____X__C2__C1__C2_tgt (w : Nat):= %v5 = "llvm.xor" (%v1,%v4) : (_, _) -> (_) "llvm.return" (%v5) : (_) -> () }] -theorem alive_AndOrXor_2063__X__C1__C2____X__C2__C1__C2 (w : Nat) : alive_AndOrXor_2063__X__C1__C2____X__C2__C1__C2_src w ⊑ alive_AndOrXor_2063__X__C1__C2____X__C2__C1__C2_tgt w := by +theorem alive_AndOrXor_2063__X__C1__C2____X__C2__C1__C2 (w : Nat) : alive_AndOrXor_2063__X__C1__C2____X__C2__C1__C2_src w ⊑ alive_AndOrXor_2063__X__C1__C2____X__C2__C1__C2_tgt w := by unfold alive_AndOrXor_2063__X__C1__C2____X__C2__C1__C2_src alive_AndOrXor_2063__X__C1__C2____X__C2__C1__C2_tgt simp_alive_peephole apply bitvec_AndOrXor_2063__X__C1__C2____X__C2__C1__C2 @@ -1494,8 +1492,8 @@ theorem alive_AndOrXor_2063__X__C1__C2____X__C2__C1__C2 (w : Nat) : alive_AndOr %r = or %A, %B -/ -def alive_AndOrXor_2113___A__B__A___A__B_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2113___A__B__A___A__B_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%A,%v1) : (_, _) -> (_) @@ -1504,8 +1502,8 @@ def alive_AndOrXor_2113___A__B__A___A__B_src (w : Nat) := "llvm.return" (%v4) : (_) -> () }] -def alive_AndOrXor_2113___A__B__A___A__B_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2113___A__B__A___A__B_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%A,%v1) : (_, _) -> (_) @@ -1513,7 +1511,7 @@ def alive_AndOrXor_2113___A__B__A___A__B_tgt (w : Nat):= %v4 = "llvm.or" (%A,%B) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_AndOrXor_2113___A__B__A___A__B (w : Nat) : alive_AndOrXor_2113___A__B__A___A__B_src w ⊑ alive_AndOrXor_2113___A__B__A___A__B_tgt w := by +theorem alive_AndOrXor_2113___A__B__A___A__B (w : Nat) : alive_AndOrXor_2113___A__B__A___A__B_src w ⊑ alive_AndOrXor_2113___A__B__A___A__B_tgt w := by unfold alive_AndOrXor_2113___A__B__A___A__B_src alive_AndOrXor_2113___A__B__A___A__B_tgt simp_alive_peephole apply bitvec_AndOrXor_2113___A__B__A___A__B @@ -1532,8 +1530,8 @@ theorem alive_AndOrXor_2113___A__B__A___A__B (w : Nat) : alive_AndOrXor_2113___ %r = or %negA, %B -/ -def alive_AndOrXor_2118___A__B__A___A__B_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2118___A__B__A___A__B_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%A,%v1) : (_, _) -> (_) @@ -1542,8 +1540,8 @@ def alive_AndOrXor_2118___A__B__A___A__B_src (w : Nat) := "llvm.return" (%v4) : (_) -> () }] -def alive_AndOrXor_2118___A__B__A___A__B_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2118___A__B__A___A__B_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%A,%v1) : (_, _) -> (_) @@ -1551,7 +1549,7 @@ def alive_AndOrXor_2118___A__B__A___A__B_tgt (w : Nat):= %v4 = "llvm.or" (%v2,%B) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_AndOrXor_2118___A__B__A___A__B (w : Nat) : alive_AndOrXor_2118___A__B__A___A__B_src w ⊑ alive_AndOrXor_2118___A__B__A___A__B_tgt w := by +theorem alive_AndOrXor_2118___A__B__A___A__B (w : Nat) : alive_AndOrXor_2118___A__B__A___A__B_src w ⊑ alive_AndOrXor_2118___A__B__A___A__B_tgt w := by unfold alive_AndOrXor_2118___A__B__A___A__B_src alive_AndOrXor_2118___A__B__A___A__B_tgt simp_alive_peephole apply bitvec_AndOrXor_2118___A__B__A___A__B @@ -1572,8 +1570,8 @@ theorem alive_AndOrXor_2118___A__B__A___A__B (w : Nat) : alive_AndOrXor_2118___ %r = xor %A, %B -/ -def alive_AndOrXor_2123___A__B__A__B___A__B_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2123___A__B__A__B___A__B_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%B,%v1) : (_, _) -> (_) @@ -1583,8 +1581,8 @@ def alive_AndOrXor_2123___A__B__A__B___A__B_src (w : Nat) := "llvm.return" (%v5) : (_) -> () }] -def alive_AndOrXor_2123___A__B__A__B___A__B_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2123___A__B__A__B___A__B_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%B,%v1) : (_, _) -> (_) @@ -1593,7 +1591,7 @@ def alive_AndOrXor_2123___A__B__A__B___A__B_tgt (w : Nat):= %v5 = "llvm.xor" (%A,%B) : (_, _) -> (_) "llvm.return" (%v5) : (_) -> () }] -theorem alive_AndOrXor_2123___A__B__A__B___A__B (w : Nat) : alive_AndOrXor_2123___A__B__A__B___A__B_src w ⊑ alive_AndOrXor_2123___A__B__A__B___A__B_tgt w := by +theorem alive_AndOrXor_2123___A__B__A__B___A__B (w : Nat) : alive_AndOrXor_2123___A__B__A__B___A__B_src w ⊑ alive_AndOrXor_2123___A__B__A__B___A__B_tgt w := by unfold alive_AndOrXor_2123___A__B__A__B___A__B_src alive_AndOrXor_2123___A__B__A__B___A__B_tgt simp_alive_peephole apply bitvec_AndOrXor_2123___A__B__A__B___A__B @@ -1616,8 +1614,8 @@ theorem alive_AndOrXor_2123___A__B__A__B___A__B (w : Nat) : alive_AndOrXor_2123 %r = xor %A, %D -/ -def alive_AndOrXor_2188_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2188_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %D : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%D,%v1) : (_, _) -> (_) @@ -1629,8 +1627,8 @@ def alive_AndOrXor_2188_src (w : Nat) := "llvm.return" (%v7) : (_) -> () }] -def alive_AndOrXor_2188_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2188_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %D : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%D,%v1) : (_, _) -> (_) @@ -1641,7 +1639,7 @@ def alive_AndOrXor_2188_tgt (w : Nat):= %v7 = "llvm.xor" (%A,%D) : (_, _) -> (_) "llvm.return" (%v7) : (_) -> () }] -theorem alive_AndOrXor_2188 (w : Nat) : alive_AndOrXor_2188_src w ⊑ alive_AndOrXor_2188_tgt w := by +theorem alive_AndOrXor_2188 (w : Nat) : alive_AndOrXor_2188_src w ⊑ alive_AndOrXor_2188_tgt w := by unfold alive_AndOrXor_2188_src alive_AndOrXor_2188_tgt simp_alive_peephole apply bitvec_AndOrXor_2188 @@ -1662,8 +1660,8 @@ theorem alive_AndOrXor_2188 (w : Nat) : alive_AndOrXor_2188_src w ⊑ alive_An %r = or %op0, %C -/ -def alive_AndOrXor_2231__A__B__B__C__A___A__B__C_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2231__A__B__B__C__A___A__B__C_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %C : _, %B : _): %v1 = "llvm.xor" (%A,%B) : (_, _) -> (_) %v2 = "llvm.xor" (%B,%C) : (_, _) -> (_) @@ -1672,8 +1670,8 @@ def alive_AndOrXor_2231__A__B__B__C__A___A__B__C_src (w : Nat) := "llvm.return" (%v4) : (_) -> () }] -def alive_AndOrXor_2231__A__B__B__C__A___A__B__C_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2231__A__B__B__C__A___A__B__C_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %C : _, %B : _): %v1 = "llvm.xor" (%A,%B) : (_, _) -> (_) %v2 = "llvm.xor" (%B,%C) : (_, _) -> (_) @@ -1681,7 +1679,7 @@ def alive_AndOrXor_2231__A__B__B__C__A___A__B__C_tgt (w : Nat):= %v4 = "llvm.or" (%v1,%C) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_AndOrXor_2231__A__B__B__C__A___A__B__C (w : Nat) : alive_AndOrXor_2231__A__B__B__C__A___A__B__C_src w ⊑ alive_AndOrXor_2231__A__B__B__C__A___A__B__C_tgt w := by +theorem alive_AndOrXor_2231__A__B__B__C__A___A__B__C (w : Nat) : alive_AndOrXor_2231__A__B__B__C__A___A__B__C_src w ⊑ alive_AndOrXor_2231__A__B__B__C__A___A__B__C_tgt w := by unfold alive_AndOrXor_2231__A__B__B__C__A___A__B__C_src alive_AndOrXor_2231__A__B__B__C__A___A__B__C_tgt simp_alive_peephole apply bitvec_AndOrXor_2231__A__B__B__C__A___A__B__C @@ -1701,8 +1699,8 @@ theorem alive_AndOrXor_2231__A__B__B__C__A___A__B__C (w : Nat) : alive_AndOrXor %r = or %B, %a -/ -def alive_AndOrXor_2243__B__C__A__B___B__A__C_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2243__B__C__A__B___B__A__C_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %C : _, %B : _): %v1 = "llvm.or" (%B,%C) : (_, _) -> (_) %v2 = "llvm.and" (%v1,%A) : (_, _) -> (_) @@ -1710,8 +1708,8 @@ def alive_AndOrXor_2243__B__C__A__B___B__A__C_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def alive_AndOrXor_2243__B__C__A__B___B__A__C_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2243__B__C__A__B___B__A__C_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %C : _, %B : _): %v1 = "llvm.and" (%A,%C) : (_, _) -> (_) %v2 = "llvm.or" (%B,%C) : (_, _) -> (_) @@ -1719,7 +1717,7 @@ def alive_AndOrXor_2243__B__C__A__B___B__A__C_tgt (w : Nat):= %v4 = "llvm.or" (%B,%v1) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_AndOrXor_2243__B__C__A__B___B__A__C (w : Nat) : alive_AndOrXor_2243__B__C__A__B___B__A__C_src w ⊑ alive_AndOrXor_2243__B__C__A__B___B__A__C_tgt w := by +theorem alive_AndOrXor_2243__B__C__A__B___B__A__C (w : Nat) : alive_AndOrXor_2243__B__C__A__B___B__A__C_src w ⊑ alive_AndOrXor_2243__B__C__A__B___B__A__C_tgt w := by unfold alive_AndOrXor_2243__B__C__A__B___B__A__C_src alive_AndOrXor_2243__B__C__A__B___B__A__C_tgt simp_alive_peephole apply bitvec_AndOrXor_2243__B__C__A__B___B__A__C @@ -1739,8 +1737,8 @@ theorem alive_AndOrXor_2243__B__C__A__B___B__A__C (w : Nat) : alive_AndOrXor_22 %r = xor %a, -1 -/ -def alive_AndOrXor_2247__A__B__A__B_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2247__A__B__A__B_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%A,%v1) : (_, _) -> (_) @@ -1750,8 +1748,8 @@ def alive_AndOrXor_2247__A__B__A__B_src (w : Nat) := "llvm.return" (%v5) : (_) -> () }] -def alive_AndOrXor_2247__A__B__A__B_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2247__A__B__A__B_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.and" (%A,%B) : (_, _) -> (_) %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -1762,7 +1760,7 @@ def alive_AndOrXor_2247__A__B__A__B_tgt (w : Nat):= %v7 = "llvm.xor" (%v1,%v6) : (_, _) -> (_) "llvm.return" (%v7) : (_) -> () }] -theorem alive_AndOrXor_2247__A__B__A__B (w : Nat) : alive_AndOrXor_2247__A__B__A__B_src w ⊑ alive_AndOrXor_2247__A__B__A__B_tgt w := by +theorem alive_AndOrXor_2247__A__B__A__B (w : Nat) : alive_AndOrXor_2247__A__B__A__B_src w ⊑ alive_AndOrXor_2247__A__B__A__B_tgt w := by unfold alive_AndOrXor_2247__A__B__A__B_src alive_AndOrXor_2247__A__B__A__B_tgt simp_alive_peephole apply bitvec_AndOrXor_2247__A__B__A__B @@ -1779,22 +1777,22 @@ theorem alive_AndOrXor_2247__A__B__A__B (w : Nat) : alive_AndOrXor_2247__A__B__ %r = or %op0, %B -/ -def alive_AndOrXor_2263_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2263_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%B : _, %op0 : _): %v1 = "llvm.xor" (%op0,%B) : (_, _) -> (_) %v2 = "llvm.or" (%op0,%v1) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -def alive_AndOrXor_2263_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2263_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%B : _, %op0 : _): %v1 = "llvm.xor" (%op0,%B) : (_, _) -> (_) %v2 = "llvm.or" (%op0,%B) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -theorem alive_AndOrXor_2263 (w : Nat) : alive_AndOrXor_2263_src w ⊑ alive_AndOrXor_2263_tgt w := by +theorem alive_AndOrXor_2263 (w : Nat) : alive_AndOrXor_2263_src w ⊑ alive_AndOrXor_2263_tgt w := by unfold alive_AndOrXor_2263_src alive_AndOrXor_2263_tgt simp_alive_peephole apply bitvec_AndOrXor_2263 @@ -1814,8 +1812,8 @@ theorem alive_AndOrXor_2263 (w : Nat) : alive_AndOrXor_2263_src w ⊑ alive_An %r = or %A, %nb -/ -def alive_AndOrXor_2264_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2264_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%A,%v1) : (_, _) -> (_) @@ -1824,8 +1822,8 @@ def alive_AndOrXor_2264_src (w : Nat) := "llvm.return" (%v4) : (_) -> () }] -def alive_AndOrXor_2264_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2264_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%B,%v1) : (_, _) -> (_) @@ -1835,7 +1833,7 @@ def alive_AndOrXor_2264_tgt (w : Nat):= %v6 = "llvm.or" (%A,%v2) : (_, _) -> (_) "llvm.return" (%v6) : (_) -> () }] -theorem alive_AndOrXor_2264 (w : Nat) : alive_AndOrXor_2264_src w ⊑ alive_AndOrXor_2264_tgt w := by +theorem alive_AndOrXor_2264 (w : Nat) : alive_AndOrXor_2264_src w ⊑ alive_AndOrXor_2264_tgt w := by unfold alive_AndOrXor_2264_src alive_AndOrXor_2264_tgt simp_alive_peephole apply bitvec_AndOrXor_2264 @@ -1854,8 +1852,8 @@ theorem alive_AndOrXor_2264 (w : Nat) : alive_AndOrXor_2264_src w ⊑ alive_An %r = or %A, %B -/ -def alive_AndOrXor_2265_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2265_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.and" (%A,%B) : (_, _) -> (_) %v2 = "llvm.xor" (%A,%B) : (_, _) -> (_) @@ -1863,15 +1861,15 @@ def alive_AndOrXor_2265_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def alive_AndOrXor_2265_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2265_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.and" (%A,%B) : (_, _) -> (_) %v2 = "llvm.xor" (%A,%B) : (_, _) -> (_) %v3 = "llvm.or" (%A,%B) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_AndOrXor_2265 (w : Nat) : alive_AndOrXor_2265_src w ⊑ alive_AndOrXor_2265_tgt w := by +theorem alive_AndOrXor_2265 (w : Nat) : alive_AndOrXor_2265_src w ⊑ alive_AndOrXor_2265_tgt w := by unfold alive_AndOrXor_2265_src alive_AndOrXor_2265_tgt simp_alive_peephole apply bitvec_AndOrXor_2265 @@ -1891,8 +1889,8 @@ theorem alive_AndOrXor_2265 (w : Nat) : alive_AndOrXor_2265_src w ⊑ alive_An %r = or %A, %not -/ -def alive_AndOrXor_2284_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2284_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.or" (%A,%B) : (_, _) -> (_) %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -1901,8 +1899,8 @@ def alive_AndOrXor_2284_src (w : Nat) := "llvm.return" (%v4) : (_) -> () }] -def alive_AndOrXor_2284_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2284_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%B,%v1) : (_, _) -> (_) @@ -1912,7 +1910,7 @@ def alive_AndOrXor_2284_tgt (w : Nat):= %v6 = "llvm.or" (%A,%v2) : (_, _) -> (_) "llvm.return" (%v6) : (_) -> () }] -theorem alive_AndOrXor_2284 (w : Nat) : alive_AndOrXor_2284_src w ⊑ alive_AndOrXor_2284_tgt w := by +theorem alive_AndOrXor_2284 (w : Nat) : alive_AndOrXor_2284_src w ⊑ alive_AndOrXor_2284_tgt w := by unfold alive_AndOrXor_2284_src alive_AndOrXor_2284_tgt simp_alive_peephole apply bitvec_AndOrXor_2284 @@ -1932,8 +1930,8 @@ theorem alive_AndOrXor_2284 (w : Nat) : alive_AndOrXor_2284_src w ⊑ alive_An %r = or %A, %not -/ -def alive_AndOrXor_2285_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2285_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.xor" (%A,%B) : (_, _) -> (_) %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -1942,8 +1940,8 @@ def alive_AndOrXor_2285_src (w : Nat) := "llvm.return" (%v4) : (_) -> () }] -def alive_AndOrXor_2285_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2285_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%B,%v1) : (_, _) -> (_) @@ -1953,7 +1951,7 @@ def alive_AndOrXor_2285_tgt (w : Nat):= %v6 = "llvm.or" (%A,%v2) : (_, _) -> (_) "llvm.return" (%v6) : (_) -> () }] -theorem alive_AndOrXor_2285 (w : Nat) : alive_AndOrXor_2285_src w ⊑ alive_AndOrXor_2285_tgt w := by +theorem alive_AndOrXor_2285 (w : Nat) : alive_AndOrXor_2285_src w ⊑ alive_AndOrXor_2285_tgt w := by unfold alive_AndOrXor_2285_src alive_AndOrXor_2285_tgt simp_alive_peephole apply bitvec_AndOrXor_2285 @@ -1974,8 +1972,8 @@ theorem alive_AndOrXor_2285 (w : Nat) : alive_AndOrXor_2285_src w ⊑ alive_An %r = xor %na, %B -/ -def alive_AndOrXor_2297_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2297_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.and" (%A,%B) : (_, _) -> (_) %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -1985,8 +1983,8 @@ def alive_AndOrXor_2297_src (w : Nat) := "llvm.return" (%v5) : (_) -> () }] -def alive_AndOrXor_2297_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2297_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%A,%v1) : (_, _) -> (_) @@ -1995,7 +1993,7 @@ def alive_AndOrXor_2297_tgt (w : Nat):= %v5 = "llvm.xor" (%v2,%B) : (_, _) -> (_) "llvm.return" (%v5) : (_) -> () }] -theorem alive_AndOrXor_2297 (w : Nat) : alive_AndOrXor_2297_src w ⊑ alive_AndOrXor_2297_tgt w := by +theorem alive_AndOrXor_2297 (w : Nat) : alive_AndOrXor_2297_src w ⊑ alive_AndOrXor_2297_tgt w := by unfold alive_AndOrXor_2297_src alive_AndOrXor_2297_tgt simp_alive_peephole apply bitvec_AndOrXor_2297 @@ -2013,23 +2011,23 @@ theorem alive_AndOrXor_2297 (w : Nat) : alive_AndOrXor_2297_src w ⊑ alive_An %r = or %i, C1 -/ -def alive_AndOrXor_2367_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2367_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %C1 : _, %op1 : _): %v1 = "llvm.or" (%A,%C1) : (_, _) -> (_) %v2 = "llvm.or" (%v1,%op1) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -def alive_AndOrXor_2367_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2367_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %C1 : _, %op1 : _): %v1 = "llvm.or" (%A,%op1) : (_, _) -> (_) %v2 = "llvm.or" (%A,%C1) : (_, _) -> (_) %v3 = "llvm.or" (%v1,%C1) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_AndOrXor_2367 (w : Nat) : alive_AndOrXor_2367_src w ⊑ alive_AndOrXor_2367_tgt w := by +theorem alive_AndOrXor_2367 (w : Nat) : alive_AndOrXor_2367_src w ⊑ alive_AndOrXor_2367_tgt w := by unfold alive_AndOrXor_2367_src alive_AndOrXor_2367_tgt simp_alive_peephole apply bitvec_AndOrXor_2367 @@ -2049,8 +2047,8 @@ theorem alive_AndOrXor_2367 (w : Nat) : alive_AndOrXor_2367_src w ⊑ alive_An %r = or %nx, %ny -/ -def alive_AndOrXor_2416_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2416_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%nx : _, %y : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%nx,%v1) : (_, _) -> (_) @@ -2060,8 +2058,8 @@ def alive_AndOrXor_2416_src (w : Nat) := "llvm.return" (%v5) : (_) -> () }] -def alive_AndOrXor_2416_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2416_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%nx : _, %y : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%y,%v1) : (_, _) -> (_) @@ -2071,7 +2069,7 @@ def alive_AndOrXor_2416_tgt (w : Nat):= %v6 = "llvm.or" (%nx,%v2) : (_, _) -> (_) "llvm.return" (%v6) : (_) -> () }] -theorem alive_AndOrXor_2416 (w : Nat) : alive_AndOrXor_2416_src w ⊑ alive_AndOrXor_2416_tgt w := by +theorem alive_AndOrXor_2416 (w : Nat) : alive_AndOrXor_2416_src w ⊑ alive_AndOrXor_2416_tgt w := by unfold alive_AndOrXor_2416_src alive_AndOrXor_2416_tgt simp_alive_peephole apply bitvec_AndOrXor_2416 @@ -2091,8 +2089,8 @@ theorem alive_AndOrXor_2416 (w : Nat) : alive_AndOrXor_2416_src w ⊑ alive_An %r = and %nx, %ny -/ -def alive_AndOrXor_2417_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2417_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%nx : _, %y : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%nx,%v1) : (_, _) -> (_) @@ -2102,8 +2100,8 @@ def alive_AndOrXor_2417_src (w : Nat) := "llvm.return" (%v5) : (_) -> () }] -def alive_AndOrXor_2417_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2417_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%nx : _, %y : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%y,%v1) : (_, _) -> (_) @@ -2113,7 +2111,7 @@ def alive_AndOrXor_2417_tgt (w : Nat):= %v6 = "llvm.and" (%nx,%v2) : (_, _) -> (_) "llvm.return" (%v6) : (_) -> () }] -theorem alive_AndOrXor_2417 (w : Nat) : alive_AndOrXor_2417_src w ⊑ alive_AndOrXor_2417_tgt w := by +theorem alive_AndOrXor_2417 (w : Nat) : alive_AndOrXor_2417_src w ⊑ alive_AndOrXor_2417_tgt w := by unfold alive_AndOrXor_2417_src alive_AndOrXor_2417_tgt simp_alive_peephole apply bitvec_AndOrXor_2417 @@ -2132,8 +2130,8 @@ theorem alive_AndOrXor_2417 (w : Nat) : alive_AndOrXor_2417_src w ⊑ alive_An %r = or %nx, %ny -/ -def alive_AndOrXor_2429_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2429_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%y : _, %x : _): %v1 = "llvm.and" (%x,%y) : (_, _) -> (_) %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -2141,8 +2139,8 @@ def alive_AndOrXor_2429_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def alive_AndOrXor_2429_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2429_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%y : _, %x : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%x,%v1) : (_, _) -> (_) @@ -2152,7 +2150,7 @@ def alive_AndOrXor_2429_tgt (w : Nat):= %v6 = "llvm.or" (%v2,%v4) : (_, _) -> (_) "llvm.return" (%v6) : (_) -> () }] -theorem alive_AndOrXor_2429 (w : Nat) : alive_AndOrXor_2429_src w ⊑ alive_AndOrXor_2429_tgt w := by +theorem alive_AndOrXor_2429 (w : Nat) : alive_AndOrXor_2429_src w ⊑ alive_AndOrXor_2429_tgt w := by unfold alive_AndOrXor_2429_src alive_AndOrXor_2429_tgt simp_alive_peephole apply bitvec_AndOrXor_2429 @@ -2171,8 +2169,8 @@ theorem alive_AndOrXor_2429 (w : Nat) : alive_AndOrXor_2429_src w ⊑ alive_An %r = and %nx, %ny -/ -def alive_AndOrXor_2430_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2430_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%y : _, %x : _): %v1 = "llvm.or" (%x,%y) : (_, _) -> (_) %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -2180,8 +2178,8 @@ def alive_AndOrXor_2430_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def alive_AndOrXor_2430_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2430_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%y : _, %x : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%x,%v1) : (_, _) -> (_) @@ -2191,7 +2189,7 @@ def alive_AndOrXor_2430_tgt (w : Nat):= %v6 = "llvm.and" (%v2,%v4) : (_, _) -> (_) "llvm.return" (%v6) : (_) -> () }] -theorem alive_AndOrXor_2430 (w : Nat) : alive_AndOrXor_2430_src w ⊑ alive_AndOrXor_2430_tgt w := by +theorem alive_AndOrXor_2430 (w : Nat) : alive_AndOrXor_2430_src w ⊑ alive_AndOrXor_2430_tgt w := by unfold alive_AndOrXor_2430_src alive_AndOrXor_2430_tgt simp_alive_peephole apply bitvec_AndOrXor_2430 @@ -2210,8 +2208,8 @@ theorem alive_AndOrXor_2430 (w : Nat) : alive_AndOrXor_2430_src w ⊑ alive_An %r = ashr %x, %y -/ -def alive_AndOrXor_2443_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2443_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%y : _, %x : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%x,%v1) : (_, _) -> (_) @@ -2221,8 +2219,8 @@ def alive_AndOrXor_2443_src (w : Nat) := "llvm.return" (%v5) : (_) -> () }] -def alive_AndOrXor_2443_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2443_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%y : _, %x : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%x,%v1) : (_, _) -> (_) @@ -2230,7 +2228,7 @@ def alive_AndOrXor_2443_tgt (w : Nat):= %v4 = "llvm.ashr" (%x,%y) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_AndOrXor_2443 (w : Nat) : alive_AndOrXor_2443_src w ⊑ alive_AndOrXor_2443_tgt w := by +theorem alive_AndOrXor_2443 (w : Nat) : alive_AndOrXor_2443_src w ⊑ alive_AndOrXor_2443_tgt w := by unfold alive_AndOrXor_2443_src alive_AndOrXor_2443_tgt simp_alive_peephole apply bitvec_AndOrXor_2443 @@ -2247,23 +2245,23 @@ theorem alive_AndOrXor_2443 (w : Nat) : alive_AndOrXor_2443_src w ⊑ alive_An %r = icmp sge %x, %y -/ -def alive_AndOrXor_2453_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2453_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%y : _, %x : _): - %v1 = "llvm.icmp.slt" (%x,%y) : (_, _) -> (_) + %v1 = "llvm.icmp.slt" (%x,%y) : (_, _) -> (i1) %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) - %v3 = "llvm.xor" (%v1,%v2) : (_, _) -> (i1) + %v3 = "llvm.xor" (%v1,%v2) : (i1, _) -> (i1) "llvm.return" (%v3) : (i1) -> () }] -def alive_AndOrXor_2453_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2453_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%y : _, %x : _): - %v1 = "llvm.icmp.slt" (%x,%y) : (_, _) -> (_) - %v2 = "llvm.icmp.sge" (%x,%y) : (_, _) -> (_) + %v1 = "llvm.icmp.slt" (%x,%y) : (_, _) -> (i1) + %v2 = "llvm.icmp.sge" (%x,%y) : (_, _) -> (i1) "llvm.return" (%v2) : (i1) -> () }] -theorem alive_AndOrXor_2453 : alive_AndOrXor_2453_src ⊑ alive_AndOrXor_2453_tgt := by +theorem alive_AndOrXor_2453 (w : Nat) : alive_AndOrXor_2453_src w ⊑ alive_AndOrXor_2453_tgt w := by unfold alive_AndOrXor_2453_src alive_AndOrXor_2453_tgt simp_alive_peephole apply bitvec_AndOrXor_2453 @@ -2280,8 +2278,8 @@ theorem alive_AndOrXor_2453 : alive_AndOrXor_2453_src ⊑ alive_AndOrXor_2453_tg %r = add %x, (-1 - C) -/ -def alive_AndOrXor_2475_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2475_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%x : _, %C : _): %v1 = "llvm.sub" (%C,%x) : (_, _) -> (_) %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -2289,8 +2287,8 @@ def alive_AndOrXor_2475_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def alive_AndOrXor_2475_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2475_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%x : _, %C : _): %v1 = "llvm.sub" (%C,%x) : (_, _) -> (_) %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -2298,7 +2296,7 @@ def alive_AndOrXor_2475_tgt (w : Nat):= %v4 = "llvm.add" (%x,%v3) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_AndOrXor_2475 (w : Nat) : alive_AndOrXor_2475_src w ⊑ alive_AndOrXor_2475_tgt w := by +theorem alive_AndOrXor_2475 (w : Nat) : alive_AndOrXor_2475_src w ⊑ alive_AndOrXor_2475_tgt w := by unfold alive_AndOrXor_2475_src alive_AndOrXor_2475_tgt simp_alive_peephole apply bitvec_AndOrXor_2475 @@ -2315,8 +2313,8 @@ theorem alive_AndOrXor_2475 (w : Nat) : alive_AndOrXor_2475_src w ⊑ alive_An %r = sub (-1 - C), %x -/ -def alive_AndOrXor_2486_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2486_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%x : _, %C : _): %v1 = "llvm.add" (%x,%C) : (_, _) -> (_) %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -2324,8 +2322,8 @@ def alive_AndOrXor_2486_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def alive_AndOrXor_2486_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2486_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%x : _, %C : _): %v1 = "llvm.add" (%x,%C) : (_, _) -> (_) %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -2333,7 +2331,7 @@ def alive_AndOrXor_2486_tgt (w : Nat):= %v4 = "llvm.sub" (%v3,%x) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_AndOrXor_2486 (w : Nat) : alive_AndOrXor_2486_src w ⊑ alive_AndOrXor_2486_tgt w := by +theorem alive_AndOrXor_2486 (w : Nat) : alive_AndOrXor_2486_src w ⊑ alive_AndOrXor_2486_tgt w := by unfold alive_AndOrXor_2486_src alive_AndOrXor_2486_tgt simp_alive_peephole apply bitvec_AndOrXor_2486 @@ -2351,16 +2349,16 @@ theorem alive_AndOrXor_2486 (w : Nat) : alive_AndOrXor_2486_src w ⊑ alive_An %r = and %a, %nop1 -/ -def alive_AndOrXor_2581__BAB___A__B_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2581__BAB___A__B_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %op1 : _): %v1 = "llvm.or" (%a,%op1) : (_, _) -> (_) %v2 = "llvm.xor" (%v1,%op1) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -def alive_AndOrXor_2581__BAB___A__B_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2581__BAB___A__B_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %op1 : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%op1,%v1) : (_, _) -> (_) @@ -2368,7 +2366,7 @@ def alive_AndOrXor_2581__BAB___A__B_tgt (w : Nat):= %v4 = "llvm.and" (%a,%v2) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_AndOrXor_2581__BAB___A__B (w : Nat) : alive_AndOrXor_2581__BAB___A__B_src w ⊑ alive_AndOrXor_2581__BAB___A__B_tgt w := by +theorem alive_AndOrXor_2581__BAB___A__B (w : Nat) : alive_AndOrXor_2581__BAB___A__B_src w ⊑ alive_AndOrXor_2581__BAB___A__B_tgt w := by unfold alive_AndOrXor_2581__BAB___A__B_src alive_AndOrXor_2581__BAB___A__B_tgt simp_alive_peephole apply bitvec_AndOrXor_2581__BAB___A__B @@ -2386,16 +2384,16 @@ theorem alive_AndOrXor_2581__BAB___A__B (w : Nat) : alive_AndOrXor_2581__BAB___ %r = and %na, %op1 -/ -def alive_AndOrXor_2587__BAA___B__A_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2587__BAA___B__A_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %op1 : _): %v1 = "llvm.and" (%a,%op1) : (_, _) -> (_) %v2 = "llvm.xor" (%v1,%op1) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -def alive_AndOrXor_2587__BAA___B__A_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2587__BAA___B__A_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %op1 : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) @@ -2403,7 +2401,7 @@ def alive_AndOrXor_2587__BAA___B__A_tgt (w : Nat):= %v4 = "llvm.and" (%v2,%op1) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_AndOrXor_2587__BAA___B__A (w : Nat) : alive_AndOrXor_2587__BAA___B__A_src w ⊑ alive_AndOrXor_2587__BAA___B__A_tgt w := by +theorem alive_AndOrXor_2587__BAA___B__A (w : Nat) : alive_AndOrXor_2587__BAA___B__A_src w ⊑ alive_AndOrXor_2587__BAA___B__A_tgt w := by unfold alive_AndOrXor_2587__BAA___B__A_src alive_AndOrXor_2587__BAA___B__A_tgt simp_alive_peephole apply bitvec_AndOrXor_2587__BAA___B__A @@ -2422,8 +2420,8 @@ theorem alive_AndOrXor_2587__BAA___B__A (w : Nat) : alive_AndOrXor_2587__BAA___ %r = xor %a, %b -/ -def alive_AndOrXor_2595_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2595_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) %v2 = "llvm.or" (%a,%b) : (_, _) -> (_) @@ -2431,15 +2429,15 @@ def alive_AndOrXor_2595_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def alive_AndOrXor_2595_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2595_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) %v2 = "llvm.or" (%a,%b) : (_, _) -> (_) %v3 = "llvm.xor" (%a,%b) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_AndOrXor_2595 (w : Nat) : alive_AndOrXor_2595_src w ⊑ alive_AndOrXor_2595_tgt w := by +theorem alive_AndOrXor_2595 (w : Nat) : alive_AndOrXor_2595_src w ⊑ alive_AndOrXor_2595_tgt w := by unfold alive_AndOrXor_2595_src alive_AndOrXor_2595_tgt simp_alive_peephole apply bitvec_AndOrXor_2595 @@ -2462,8 +2460,8 @@ theorem alive_AndOrXor_2595 (w : Nat) : alive_AndOrXor_2595_src w ⊑ alive_An %r = xor %a, %b -/ -def alive_AndOrXor_2607_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2607_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) @@ -2475,8 +2473,8 @@ def alive_AndOrXor_2607_src (w : Nat) := "llvm.return" (%v7) : (_) -> () }] -def alive_AndOrXor_2607_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2607_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) @@ -2487,7 +2485,7 @@ def alive_AndOrXor_2607_tgt (w : Nat):= %v7 = "llvm.xor" (%a,%b) : (_, _) -> (_) "llvm.return" (%v7) : (_) -> () }] -theorem alive_AndOrXor_2607 (w : Nat) : alive_AndOrXor_2607_src w ⊑ alive_AndOrXor_2607_tgt w := by +theorem alive_AndOrXor_2607 (w : Nat) : alive_AndOrXor_2607_src w ⊑ alive_AndOrXor_2607_tgt w := by unfold alive_AndOrXor_2607_src alive_AndOrXor_2607_tgt simp_alive_peephole apply bitvec_AndOrXor_2607 @@ -2510,8 +2508,8 @@ theorem alive_AndOrXor_2607 (w : Nat) : alive_AndOrXor_2607_src w ⊑ alive_An %r = xor %a, %b -/ -def alive_AndOrXor_2617_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2617_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) @@ -2523,8 +2521,8 @@ def alive_AndOrXor_2617_src (w : Nat) := "llvm.return" (%v7) : (_) -> () }] -def alive_AndOrXor_2617_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2617_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) @@ -2535,7 +2533,7 @@ def alive_AndOrXor_2617_tgt (w : Nat):= %v7 = "llvm.xor" (%a,%b) : (_, _) -> (_) "llvm.return" (%v7) : (_) -> () }] -theorem alive_AndOrXor_2617 (w : Nat) : alive_AndOrXor_2617_src w ⊑ alive_AndOrXor_2617_tgt w := by +theorem alive_AndOrXor_2617 (w : Nat) : alive_AndOrXor_2617_src w ⊑ alive_AndOrXor_2617_tgt w := by unfold alive_AndOrXor_2617_src alive_AndOrXor_2617_tgt simp_alive_peephole apply bitvec_AndOrXor_2617 @@ -2556,8 +2554,8 @@ theorem alive_AndOrXor_2617 (w : Nat) : alive_AndOrXor_2617_src w ⊑ alive_An %r = xor %and, %c -/ -def alive_AndOrXor_2627_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2627_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %c : _, %b : _): %v1 = "llvm.xor" (%a,%c) : (_, _) -> (_) %v2 = "llvm.or" (%a,%b) : (_, _) -> (_) @@ -2565,8 +2563,8 @@ def alive_AndOrXor_2627_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def alive_AndOrXor_2627_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2627_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %c : _, %b : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) @@ -2576,7 +2574,7 @@ def alive_AndOrXor_2627_tgt (w : Nat):= %v6 = "llvm.xor" (%v3,%c) : (_, _) -> (_) "llvm.return" (%v6) : (_) -> () }] -theorem alive_AndOrXor_2627 (w : Nat) : alive_AndOrXor_2627_src w ⊑ alive_AndOrXor_2627_tgt w := by +theorem alive_AndOrXor_2627 (w : Nat) : alive_AndOrXor_2627_src w ⊑ alive_AndOrXor_2627_tgt w := by unfold alive_AndOrXor_2627_src alive_AndOrXor_2627_tgt simp_alive_peephole apply bitvec_AndOrXor_2627 @@ -2595,8 +2593,8 @@ theorem alive_AndOrXor_2627 (w : Nat) : alive_AndOrXor_2627_src w ⊑ alive_An %r = or %a, %b -/ -def alive_AndOrXor_2647_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2647_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) %v2 = "llvm.xor" (%a,%b) : (_, _) -> (_) @@ -2604,15 +2602,15 @@ def alive_AndOrXor_2647_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def alive_AndOrXor_2647_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2647_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) %v2 = "llvm.xor" (%a,%b) : (_, _) -> (_) %v3 = "llvm.or" (%a,%b) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_AndOrXor_2647 (w : Nat) : alive_AndOrXor_2647_src w ⊑ alive_AndOrXor_2647_tgt w := by +theorem alive_AndOrXor_2647 (w : Nat) : alive_AndOrXor_2647_src w ⊑ alive_AndOrXor_2647_tgt w := by unfold alive_AndOrXor_2647_src alive_AndOrXor_2647_tgt simp_alive_peephole apply bitvec_AndOrXor_2647 @@ -2634,8 +2632,8 @@ theorem alive_AndOrXor_2647 (w : Nat) : alive_AndOrXor_2647_src w ⊑ alive_An %r = xor %and, -1 -/ -def alive_AndOrXor_2658_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2658_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%b,%v1) : (_, _) -> (_) @@ -2646,8 +2644,8 @@ def alive_AndOrXor_2658_src (w : Nat) := "llvm.return" (%v6) : (_) -> () }] -def alive_AndOrXor_2658_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2658_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): %v1 = "llvm.and" (%a,%b) : (_, _) -> (_) %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -2659,7 +2657,7 @@ def alive_AndOrXor_2658_tgt (w : Nat):= %v8 = "llvm.xor" (%v1,%v7) : (_, _) -> (_) "llvm.return" (%v8) : (_) -> () }] -theorem alive_AndOrXor_2658 (w : Nat) : alive_AndOrXor_2658_src w ⊑ alive_AndOrXor_2658_tgt w := by +theorem alive_AndOrXor_2658 (w : Nat) : alive_AndOrXor_2658_src w ⊑ alive_AndOrXor_2658_tgt w := by unfold alive_AndOrXor_2658_src alive_AndOrXor_2658_tgt simp_alive_peephole apply bitvec_AndOrXor_2658 @@ -2678,24 +2676,24 @@ theorem alive_AndOrXor_2658 (w : Nat) : alive_AndOrXor_2658_src w ⊑ alive_An %r = icmp uge %a, %b -/ -def alive_AndOrXor_2663_src (w : Nat) := -[mlir_icom (w)| { +def alive_AndOrXor_2663_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): - %v1 = "llvm.icmp.ule" (%a,%b) : (_, _) -> (_) - %v2 = "llvm.icmp.ne" (%a,%b) : (_, _) -> (_) - %v3 = "llvm.xor" (%v1,%v2) : (_, _) -> (i1) + %v1 = "llvm.icmp.ule" (%a,%b) : (_, _) -> (i1) + %v2 = "llvm.icmp.ne" (%a,%b) : (_, _) -> (i1) + %v3 = "llvm.xor" (%v1,%v2) : (i1, i1) -> (i1) "llvm.return" (%v3) : (i1) -> () }] -def alive_AndOrXor_2663_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_AndOrXor_2663_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): - %v1 = "llvm.icmp.ule" (%a,%b) : (_, _) -> (_) - %v2 = "llvm.icmp.ne" (%a,%b) : (_, _) -> (_) - %v3 = "llvm.icmp.uge" (%a,%b) : (_, _) -> (_) + %v1 = "llvm.icmp.ule" (%a,%b) : (_, _) -> (i1) + %v2 = "llvm.icmp.ne" (%a,%b) : (_, _) -> (i1) + %v3 = "llvm.icmp.uge" (%a,%b) : (_, _) -> (i1) "llvm.return" (%v3) : (i1) -> () }] -theorem alive_AndOrXor_2663 : alive_AndOrXor_2663_src ⊑ alive_AndOrXor_2663_tgt := by +theorem alive_AndOrXor_2663 (w : Nat) : alive_AndOrXor_2663_src w ⊑ alive_AndOrXor_2663_tgt w := by unfold alive_AndOrXor_2663_src alive_AndOrXor_2663_tgt simp_alive_peephole apply bitvec_AndOrXor_2663 @@ -2710,22 +2708,22 @@ theorem alive_AndOrXor_2663 : alive_AndOrXor_2663_src ⊑ alive_AndOrXor_2663_tg %r = sub 0, %x -/ -def alive_152_src (w : Nat) := -[mlir_icom (w)| { +def alive_152_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%x : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.mul" (%x,%v1) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -def alive_152_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_152_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%x : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v2 = "llvm.sub" (%v1,%x) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -theorem alive_152 (w : Nat) : alive_152_src w ⊑ alive_152_tgt w := by +theorem alive_152 (w : Nat) : alive_152_src w ⊑ alive_152_tgt w := by unfold alive_152_src alive_152_tgt simp_alive_peephole apply bitvec_152 @@ -2744,16 +2742,16 @@ theorem alive_152 (w : Nat) : alive_152_src w ⊑ alive_152_tgt w := by %r = add %tmp, %mul -/ -def alive_229_src (w : Nat) := -[mlir_icom (w)| { +def alive_229_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%X : _, %C1 : _, %Op1 : _): %v1 = "llvm.add" (%X,%C1) : (_, _) -> (_) %v2 = "llvm.mul" (%v1,%Op1) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -def alive_229_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_229_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%X : _, %C1 : _, %Op1 : _): %v1 = "llvm.mul" (%C1,%Op1) : (_, _) -> (_) %v2 = "llvm.mul" (%X,%Op1) : (_, _) -> (_) @@ -2761,7 +2759,7 @@ def alive_229_tgt (w : Nat):= %v4 = "llvm.add" (%v2,%v1) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_229 (w : Nat) : alive_229_src w ⊑ alive_229_tgt w := by +theorem alive_229 (w : Nat) : alive_229_src w ⊑ alive_229_tgt w := by unfold alive_229_src alive_229_tgt simp_alive_peephole apply bitvec_229 @@ -2780,8 +2778,8 @@ theorem alive_229 (w : Nat) : alive_229_src w ⊑ alive_229_tgt w := by %r = mul %X, %Y -/ -def alive_239_src (w : Nat) := -[mlir_icom (w)| { +def alive_239_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%Y : _, %X : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v2 = "llvm.sub" (%v1,%X) : (_, _) -> (_) @@ -2791,8 +2789,8 @@ def alive_239_src (w : Nat) := "llvm.return" (%v5) : (_) -> () }] -def alive_239_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_239_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%Y : _, %X : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v2 = "llvm.sub" (%v1,%X) : (_, _) -> (_) @@ -2801,7 +2799,7 @@ def alive_239_tgt (w : Nat):= %v5 = "llvm.mul" (%X,%Y) : (_, _) -> (_) "llvm.return" (%v5) : (_) -> () }] -theorem alive_239 (w : Nat) : alive_239_src w ⊑ alive_239_tgt w := by +theorem alive_239 (w : Nat) : alive_239_src w ⊑ alive_239_tgt w := by unfold alive_239_src alive_239_tgt simp_alive_peephole apply bitvec_239 @@ -2819,7 +2817,7 @@ theorem alive_239 (w : Nat) : alive_239_src w ⊑ alive_239_tgt w := by %r = sub %X, %rem -/ -def alive_275_src := +def alive_275_src := [mlir_icom ()| { ^bb0(%Y : i5, %X : i5): %v1 = "llvm.udiv" (%X,%Y) : (i5, i5) -> (i5) @@ -2827,7 +2825,7 @@ def alive_275_src := "llvm.return" (%v2) : (i5) -> () }] -def alive_275_tgt := +def alive_275_tgt := [mlir_icom ()| { ^bb0(%Y : i5, %X : i5): %v1 = "llvm.urem" (%X,%Y) : (i5, i5) -> (i5) @@ -2835,7 +2833,7 @@ def alive_275_tgt := %v3 = "llvm.sub" (%X,%v1) : (i5, i5) -> (i5) "llvm.return" (%v3) : (i5) -> () }] -theorem alive_275 : alive_275_src ⊑ alive_275_tgt := by +theorem alive_275 : alive_275_src ⊑ alive_275_tgt := by unfold alive_275_src alive_275_tgt simp_alive_peephole apply bitvec_275 @@ -2853,7 +2851,7 @@ theorem alive_275 : alive_275_src ⊑ alive_275_tgt := by %r = sub %X, %rem -/ -def alive_275_2_src := +def alive_275_2_src := [mlir_icom ()| { ^bb0(%Y : i5, %X : i5): %v1 = "llvm.sdiv" (%X,%Y) : (i5, i5) -> (i5) @@ -2861,7 +2859,7 @@ def alive_275_2_src := "llvm.return" (%v2) : (i5) -> () }] -def alive_275_2_tgt := +def alive_275_2_tgt := [mlir_icom ()| { ^bb0(%Y : i5, %X : i5): %v1 = "llvm.srem" (%X,%Y) : (i5, i5) -> (i5) @@ -2869,7 +2867,7 @@ def alive_275_2_tgt := %v3 = "llvm.sub" (%X,%v1) : (i5, i5) -> (i5) "llvm.return" (%v3) : (i5) -> () }] -theorem alive_275_2 : alive_275_2_src ⊑ alive_275_2_tgt := by +theorem alive_275_2 : alive_275_2_src ⊑ alive_275_2_tgt := by unfold alive_275_2_src alive_275_2_tgt simp_alive_peephole apply bitvec_275_2 @@ -2889,8 +2887,8 @@ theorem alive_275_2 : alive_275_2_src ⊑ alive_275_2_tgt := by %r = sub %rem, %X -/ -def alive_276_src := -[mlir_icom ()| { +def alive_276_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%Y : i5, %X : i5): %v1 = "llvm.sdiv" (%X,%Y) : (i5, i5) -> (i5) %v2 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) @@ -2899,8 +2897,8 @@ def alive_276_src := "llvm.return" (%v4) : (i5) -> () }] -def alive_276_tgt := -[mlir_icom ()| { +def alive_276_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%Y : i5, %X : i5): %v1 = "llvm.srem" (%X,%Y) : (i5, i5) -> (i5) %v2 = "llvm.sdiv" (%X,%Y) : (i5, i5) -> (i5) @@ -2909,7 +2907,7 @@ def alive_276_tgt := %v5 = "llvm.sub" (%v1,%X) : (i5, i5) -> (i5) "llvm.return" (%v5) : (i5) -> () }] -theorem alive_276 : alive_276_src ⊑ alive_276_tgt := by +theorem alive_276 (w : Nat) : alive_276_src w ⊑ alive_276_tgt w := by unfold alive_276_src alive_276_tgt simp_alive_peephole apply bitvec_276 @@ -2929,8 +2927,8 @@ theorem alive_276 : alive_276_src ⊑ alive_276_tgt := by %r = sub %rem, %X -/ -def alive_276_2_src := -[mlir_icom ()| { +def alive_276_2_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%Y : i5, %X : i5): %v1 = "llvm.udiv" (%X,%Y) : (i5, i5) -> (i5) %v2 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) @@ -2939,8 +2937,8 @@ def alive_276_2_src := "llvm.return" (%v4) : (i5) -> () }] -def alive_276_2_tgt := -[mlir_icom ()| { +def alive_276_2_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%Y : i5, %X : i5): %v1 = "llvm.urem" (%X,%Y) : (i5, i5) -> (i5) %v2 = "llvm.udiv" (%X,%Y) : (i5, i5) -> (i5) @@ -2949,7 +2947,7 @@ def alive_276_2_tgt := %v5 = "llvm.sub" (%v1,%X) : (i5, i5) -> (i5) "llvm.return" (%v5) : (i5) -> () }] -theorem alive_276_2 : alive_276_2_src ⊑ alive_276_2_tgt := by +theorem alive_276_2 (w : Nat) : alive_276_2_src w ⊑ alive_276_2_tgt w := by unfold alive_276_2_src alive_276_2_tgt simp_alive_peephole apply bitvec_276_2 @@ -2964,20 +2962,20 @@ theorem alive_276_2 : alive_276_2_src ⊑ alive_276_2_tgt := by %r = and %X, %Y -/ -def alive_283_src := +def alive_283_src := [mlir_icom ()| { ^bb0(%Y : i1, %X : i1): %v1 = "llvm.mul" (%X,%Y) : (i1, i1) -> (i1) "llvm.return" (%v1) : (i1) -> () }] -def alive_283_tgt := +def alive_283_tgt := [mlir_icom ()| { ^bb0(%Y : i1, %X : i1): %v1 = "llvm.and" (%X,%Y) : (i1, i1) -> (i1) "llvm.return" (%v1) : (i1) -> () }] -theorem alive_283 : alive_283_src ⊑ alive_283_tgt := by +theorem alive_283 : alive_283_src ⊑ alive_283_tgt := by unfold alive_283_src alive_283_tgt simp_alive_peephole apply bitvec_283 @@ -2994,8 +2992,8 @@ theorem alive_283 : alive_283_src ⊑ alive_283_tgt := by %r = shl %Op1, %Y -/ -def alive_290__292_src (w : Nat) := -[mlir_icom (w)| { +def alive_290__292_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%Y : _, %Op1 : _): %v1 = "llvm.mlir.constant" () { value = 1 : _ } :() -> (_) %v2 = "llvm.shl" (%v1,%Y) : (_, _) -> (_) @@ -3003,15 +3001,15 @@ def alive_290__292_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def alive_290__292_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_290__292_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%Y : _, %Op1 : _): %v1 = "llvm.mlir.constant" () { value = 1 : _ } :() -> (_) %v2 = "llvm.shl" (%v1,%Y) : (_, _) -> (_) %v3 = "llvm.shl" (%Op1,%Y) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_290__292 (w : Nat) : alive_290__292_src w ⊑ alive_290__292_tgt w := by +theorem alive_290__292 (w : Nat) : alive_290__292_src w ⊑ alive_290__292_tgt w := by unfold alive_290__292_src alive_290__292_tgt simp_alive_peephole apply bitvec_290__292 @@ -3028,26 +3026,26 @@ theorem alive_290__292 (w : Nat) : alive_290__292_src w ⊑ alive_290__292_tgt %r = select i1 %c, %X, 0 -/ -def alive_805_src (w : Nat) := -[mlir_icom (w)| { +def alive_805_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%X : _): %v1 = "llvm.mlir.constant" () { value = 1 : _ } :() -> (_) %v2 = "llvm.sdiv" (%v1,%X) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -def alive_805_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_805_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%X : _): %v1 = "llvm.mlir.constant" () { value = 1 : _ } :() -> (_) - %v2 = "llvm.add" (%X,%v1) : (_, _) -> (_) + %v2 = "llvm.add" (%X,%v1) : (_, _) -> (i1) %v3 = "llvm.mlir.constant" () { value = 3 : _ } :() -> (_) - %v4 = "llvm.icmp.ult" (%v2,%v3) : (_, _) -> (_) + %v4 = "llvm.icmp.ult" (%v2,%v3) : (_, _) -> (i1) %v5 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v6 = "llvm.select" (%v4,%X,%v5) : (_, _, _) -> (_) + %v6 = "llvm.select" (%v4,%X,%v5) : (i1, _, _) -> (_) "llvm.return" (%v6) : (_) -> () }] -theorem alive_805 (w : Nat) : alive_805_src w ⊑ alive_805_tgt w := by +theorem alive_805 (w : Nat) : alive_805_src w ⊑ alive_805_tgt w := by unfold alive_805_src alive_805_tgt simp_alive_peephole apply bitvec_805 @@ -3066,7 +3064,7 @@ theorem alive_805 (w : Nat) : alive_805_src w ⊑ alive_805_tgt w := by %r = sdiv %X, %Op1 -/ -def alive_820_src := +def alive_820_src := [mlir_icom ()| { ^bb0(%X : i9, %Op1 : i9): %v1 = "llvm.srem" (%X,%Op1) : (i9, i9) -> (i9) @@ -3075,7 +3073,7 @@ def alive_820_src := "llvm.return" (%v3) : (i9) -> () }] -def alive_820_tgt := +def alive_820_tgt := [mlir_icom ()| { ^bb0(%X : i9, %Op1 : i9): %v1 = "llvm.srem" (%X,%Op1) : (i9, i9) -> (i9) @@ -3083,7 +3081,7 @@ def alive_820_tgt := %v3 = "llvm.sdiv" (%X,%Op1) : (i9, i9) -> (i9) "llvm.return" (%v3) : (i9) -> () }] -theorem alive_820 : alive_820_src ⊑ alive_820_tgt := by +theorem alive_820 : alive_820_src ⊑ alive_820_tgt := by unfold alive_820_src alive_820_tgt simp_alive_peephole apply bitvec_820 @@ -3102,7 +3100,7 @@ theorem alive_820 : alive_820_src ⊑ alive_820_tgt := by %r = udiv %X, %Op1 -/ -def alive_820'_src := +def alive_820'_src := [mlir_icom ()| { ^bb0(%X : i9, %Op1 : i9): %v1 = "llvm.urem" (%X,%Op1) : (i9, i9) -> (i9) @@ -3111,7 +3109,7 @@ def alive_820'_src := "llvm.return" (%v3) : (i9) -> () }] -def alive_820'_tgt := +def alive_820'_tgt := [mlir_icom ()| { ^bb0(%X : i9, %Op1 : i9): %v1 = "llvm.urem" (%X,%Op1) : (i9, i9) -> (i9) @@ -3119,7 +3117,7 @@ def alive_820'_tgt := %v3 = "llvm.udiv" (%X,%Op1) : (i9, i9) -> (i9) "llvm.return" (%v3) : (i9) -> () }] -theorem alive_820' : alive_820'_src ⊑ alive_820'_tgt := by +theorem alive_820' : alive_820'_src ⊑ alive_820'_tgt := by unfold alive_820'_src alive_820'_tgt simp_alive_peephole apply bitvec_820' @@ -3134,22 +3132,22 @@ theorem alive_820' : alive_820'_src ⊑ alive_820'_tgt := by %r = sub 0, %X -/ -def alive_1030_src (w : Nat) := -[mlir_icom (w)| { +def alive_1030_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%X : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.sdiv" (%X,%v1) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -def alive_1030_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_1030_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%X : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v2 = "llvm.sub" (%v1,%X) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -theorem alive_1030 (w : Nat) : alive_1030_src w ⊑ alive_1030_tgt w := by +theorem alive_1030 (w : Nat) : alive_1030_src w ⊑ alive_1030_tgt w := by unfold alive_1030_src alive_1030_tgt simp_alive_peephole apply bitvec_1030 @@ -3166,22 +3164,22 @@ theorem alive_1030 (w : Nat) : alive_1030_src w ⊑ alive_1030_tgt w := by %r = select i1 %c, C, %Y -/ -def alive_Select_637_src (w : Nat) := -[mlir_icom (w)| { +def alive_Select_637_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%Y : _, %X : _, %C : _): - %v1 = "llvm.icmp.eq" (%X,%C) : (_, _) -> (_) - %v2 = "llvm.select" (%v1,%X,%Y) : (_, _, _) -> (_) + %v1 = "llvm.icmp.eq" (%X,%C) : (_, _) -> (i1) + %v2 = "llvm.select" (%v1,%X,%Y) : (i1, _, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -def alive_Select_637_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_Select_637_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%Y : _, %X : _, %C : _): - %v1 = "llvm.icmp.eq" (%X,%C) : (_, _) -> (_) - %v2 = "llvm.select" (%v1,%C,%Y) : (_, _, _) -> (_) + %v1 = "llvm.icmp.eq" (%X,%C) : (_, _) -> (i1) + %v2 = "llvm.select" (%v1,%C,%Y) : (i1, _, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -theorem alive_Select_637 (w : Nat) : alive_Select_637_src w ⊑ alive_Select_637_tgt w := by +theorem alive_Select_637 (w : Nat) : alive_Select_637_src w ⊑ alive_Select_637_tgt w := by unfold alive_Select_637_src alive_Select_637_tgt simp_alive_peephole apply bitvec_Select_637 @@ -3198,22 +3196,22 @@ theorem alive_Select_637 (w : Nat) : alive_Select_637_src w ⊑ alive_Select_6 %r = select i1 %c, %Y, C -/ -def alive_Select_641_src (w : Nat) := -[mlir_icom (w)| { +def alive_Select_641_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%Y : _, %X : _, %C : _): - %v1 = "llvm.icmp.ne" (%X,%C) : (_, _) -> (_) - %v2 = "llvm.select" (%v1,%Y,%X) : (_, _, _) -> (_) + %v1 = "llvm.icmp.ne" (%X,%C) : (_, _) -> (i1) + %v2 = "llvm.select" (%v1,%Y,%X) : (i1, _, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -def alive_Select_641_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_Select_641_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%Y : _, %X : _, %C : _): - %v1 = "llvm.icmp.ne" (%X,%C) : (_, _) -> (_) - %v2 = "llvm.select" (%v1,%Y,%C) : (_, _, _) -> (_) + %v1 = "llvm.icmp.ne" (%X,%C) : (_, _) -> (i1) + %v2 = "llvm.select" (%v1,%Y,%C) : (i1, _, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -theorem alive_Select_641 (w : Nat) : alive_Select_641_src w ⊑ alive_Select_641_tgt w := by +theorem alive_Select_641 (w : Nat) : alive_Select_641_src w ⊑ alive_Select_641_tgt w := by unfold alive_Select_641_src alive_Select_641_tgt simp_alive_peephole apply bitvec_Select_641 @@ -3234,26 +3232,26 @@ theorem alive_Select_641 (w : Nat) : alive_Select_641_src w ⊑ alive_Select_6 %umax2 = select i1 %c, %A, %B -/ -def alive_Select_699_src (w : Nat) := -[mlir_icom (w)| { +def alive_Select_699_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): - %v1 = "llvm.icmp.uge" (%A,%B) : (_, _) -> (_) - %v2 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) - %v3 = "llvm.icmp.uge" (%v2,%B) : (_, _) -> (_) - %v4 = "llvm.select" (%v3,%v2,%B) : (_, _, _) -> (_) - "llvm.return" (%v4) : (_) -> () + %v1 = "llvm.icmp.uge" (%A,%B) : (_, _) -> (i1) + %v2 = "llvm.select" (%v1,%A,%B) : (i1, _, _) -> (i1) + %v3 = "llvm.icmp.uge" (%v2,%B) : (_, _) -> (i1) + %v4 = "llvm.select" (%v3,%v2,%B) : (i1, _, _) -> (i1) + "llvm.return" (%v4) : (i1) -> () }] -def alive_Select_699_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_Select_699_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): - %v1 = "llvm.icmp.uge" (%A,%B) : (_, _) -> (_) - %v2 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) - %v3 = "llvm.icmp.uge" (%v2,%B) : (_, _) -> (_) - %v4 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) - "llvm.return" (%v4) : (_) -> () + %v1 = "llvm.icmp.uge" (%A,%B) : (_, _) -> (i1) + %v2 = "llvm.select" (%v1,%A,%B) : (i1, _, _) -> (_) + %v3 = "llvm.icmp.uge" (%v2,%B) : (_, _) -> (i1) + %v4 = "llvm.select" (%v1,%A,%B) : (i1, _, _) -> (i1) + "llvm.return" (%v4) : (i1) -> () }] -theorem alive_Select_699 (w : Nat) : alive_Select_699_src w ⊑ alive_Select_699_tgt w := by +theorem alive_Select_699 (w : Nat) : alive_Select_699_src w ⊑ alive_Select_699_tgt w := by unfold alive_Select_699_src alive_Select_699_tgt simp_alive_peephole apply bitvec_Select_699 @@ -3274,26 +3272,23 @@ theorem alive_Select_699 (w : Nat) : alive_Select_699_src w ⊑ alive_Select_6 %smin2 = select i1 %c, %A, %B -/ -def alive_Select_700_src (w : Nat) := -[mlir_icom (w)| { -^bb0(%A : _, %B : _): - %v1 = "llvm.icmp.slt" (%A,%B) : (_, _) -> (_) - %v2 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) - %v3 = "llvm.icmp.slt" (%v2,%B) : (_, _) -> (_) - %v4 = "llvm.select" (%v3,%v2,%B) : (_, _, _) -> (_) - "llvm.return" (%v4) : (_) -> () +def alive_Select_700_src (w : Nat) := +[mlir_icom ( w )| { +^bb0(%A : _, %B : _, %C : i1): + %v4 = "llvm.select" (%C, %A, %B) : (i1, _, _) -> (i1) + "llvm.return" (%v4) : (i1) -> () }] -def alive_Select_700_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_Select_700_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): - %v1 = "llvm.icmp.slt" (%A,%B) : (_, _) -> (_) - %v2 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) - %v3 = "llvm.icmp.slt" (%v2,%B) : (_, _) -> (_) - %v4 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) - "llvm.return" (%v4) : (_) -> () + %v1 = "llvm.icmp.slt" (%A,%B) : (_, _) -> (i1) + %v2 = "llvm.select" (%v1,%A,%B) : (i1, _, _) -> (_) + %v3 = "llvm.icmp.slt" (%v2,%B) : (_, _) -> (i1) + %v4 = "llvm.select" (%v1,%A,%B) : (i1, _, _) -> (i1) + "llvm.return" (%v4) : (i1) -> () }] -theorem alive_Select_700 (w : Nat) : alive_Select_700_src w ⊑ alive_Select_700_tgt w := by +theorem alive_Select_700 (w : Nat) : alive_Select_700_src w ⊑ alive_Select_700_tgt w := by unfold alive_Select_700_src alive_Select_700_tgt simp_alive_peephole apply bitvec_Select_700 @@ -3314,26 +3309,26 @@ theorem alive_Select_700 (w : Nat) : alive_Select_700_src w ⊑ alive_Select_7 %smax = %A -/ -def alive_Select_704_src (w : Nat) := -[mlir_icom (w)| { +def alive_Select_704_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): - %v1 = "llvm.icmp.slt" (%A,%B) : (_, _) -> (_) - %v2 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) - %v3 = "llvm.icmp.sge" (%v2,%A) : (_, _) -> (_) - %v4 = "llvm.select" (%v3,%v2,%A) : (_, _, _) -> (_) - "llvm.return" (%v4) : (_) -> () + %v1 = "llvm.icmp.slt" (%A,%B) : (_, _) -> (i1) + %v2 = "llvm.select" (%v1,%A,%B) : (i1, _, _) -> (i1) + %v3 = "llvm.icmp.sge" (%v2,%A) : (_, _) -> (i1) + %v4 = "llvm.select" (%v3,%v2,%A) : (i1, _, _) -> (i1) + "llvm.return" (%v4) : (i1) -> () }] -def alive_Select_704_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_Select_704_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): - %v1 = "llvm.icmp.slt" (%A,%B) : (_, _) -> (_) - %v2 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) - %v3 = "llvm.icmp.sge" (%v2,%A) : (_, _) -> (_) - %v4 = "llvm.copy" (%A) : (_) -> (_) - "llvm.return" (%v4) : (_) -> () + %v1 = "llvm.icmp.slt" (%A,%B) : (_, _) -> (i1) + %v2 = "llvm.select" (%v1,%A,%B) : (i1, _, _) -> (_) + %v3 = "llvm.icmp.sge" (%v2,%A) : (_, _) -> (i1) + %v4 = "llvm.copy" (%A) : (_) -> (i1) + "llvm.return" (%v4) : (i1) -> () }] -theorem alive_Select_704 (w : Nat) : alive_Select_704_src w ⊑ alive_Select_704_tgt w := by +theorem alive_Select_704 (w : Nat) : alive_Select_704_src w ⊑ alive_Select_704_tgt w := by unfold alive_Select_704_src alive_Select_704_tgt simp_alive_peephole apply bitvec_Select_704 @@ -3354,26 +3349,26 @@ theorem alive_Select_704 (w : Nat) : alive_Select_704_src w ⊑ alive_Select_7 %umin = %A -/ -def alive_Select_705_src (w : Nat) := -[mlir_icom (w)| { +def alive_Select_705_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): - %v1 = "llvm.icmp.sge" (%A,%B) : (_, _) -> (_) - %v2 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) - %v3 = "llvm.icmp.slt" (%v2,%A) : (_, _) -> (_) - %v4 = "llvm.select" (%v3,%v2,%A) : (_, _, _) -> (_) - "llvm.return" (%v4) : (_) -> () + %v1 = "llvm.icmp.sge" (%A,%B) : (_, _) -> (i1) + %v2 = "llvm.select" (%v1,%A,%B) : (i1, _, _) -> (i1) + %v3 = "llvm.icmp.slt" (%v2,%A) : (_, _) -> (i1) + %v4 = "llvm.select" (%v3,%v2,%A) : (i1, _, _) -> (i1) + "llvm.return" (%v4) : (i1) -> () }] -def alive_Select_705_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_Select_705_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _, %B : _): - %v1 = "llvm.icmp.sge" (%A,%B) : (_, _) -> (_) - %v2 = "llvm.select" (%v1,%A,%B) : (_, _, _) -> (_) - %v3 = "llvm.icmp.slt" (%v2,%A) : (_, _) -> (_) - %v4 = "llvm.copy" (%A) : (_) -> (_) - "llvm.return" (%v4) : (_) -> () + %v1 = "llvm.icmp.sge" (%A,%B) : (_, _) -> (i1) + %v2 = "llvm.select" (%v1,%A,%B) : (i1, _, _) -> (_) + %v3 = "llvm.icmp.slt" (%v2,%A) : (_, _) -> (i1) + %v4 = "llvm.copy" (%A) : (_) -> (i1) + "llvm.return" (%v4) : (i1) -> () }] -theorem alive_Select_705 (w : Nat) : alive_Select_705_src w ⊑ alive_Select_705_tgt w := by +theorem alive_Select_705 (w : Nat) : alive_Select_705_src w ⊑ alive_Select_705_tgt w := by unfold alive_Select_705_src alive_Select_705_tgt simp_alive_peephole apply bitvec_Select_705 @@ -3398,38 +3393,38 @@ theorem alive_Select_705 (w : Nat) : alive_Select_705_src w ⊑ alive_Select_7 %abs2 = select i1 %c, %A, %minus -/ -def alive_Select_740_src (w : Nat) := -[mlir_icom (w)| { +def alive_Select_740_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v2 = "llvm.icmp.sgt" (%A,%v1) : (_, _) -> (_) + %v2 = "llvm.icmp.sgt" (%A,%v1) : (_, _) -> (i1) %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v4 = "llvm.sub" (%v3,%A) : (_, _) -> (_) - %v5 = "llvm.select" (%v2,%A,%v4) : (_, _, _) -> (_) + %v4 = "llvm.sub" (%v3,%A) : (_, _) -> (i1) + %v5 = "llvm.select" (%v2,%A,%v4) : (i1, _, _) -> (i1) %v6 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) - %v7 = "llvm.icmp.sgt" (%v5,%v6) : (_, _) -> (_) + %v7 = "llvm.icmp.sgt" (%v5,%v6) : (_, _) -> (i1) %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v9 = "llvm.sub" (%v8,%v5) : (_, _) -> (_) - %v10 = "llvm.select" (%v7,%v5,%v9) : (_, _, _) -> (_) - "llvm.return" (%v10) : (_) -> () + %v10 = "llvm.select" (%v7,%v5,%v9) : (i1, _, _) -> (i1) + "llvm.return" (%v10) : (i1) -> () }] -def alive_Select_740_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_Select_740_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v2 = "llvm.icmp.sgt" (%A,%v1) : (_, _) -> (_) + %v2 = "llvm.icmp.sgt" (%A,%v1) : (_, _) -> (i1) %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v4 = "llvm.sub" (%v3,%A) : (_, _) -> (_) - %v5 = "llvm.select" (%v2,%A,%v4) : (_, _, _) -> (_) + %v4 = "llvm.sub" (%v3,%A) : (_, _) -> (i1) + %v5 = "llvm.select" (%v2,%A,%v4) : (i1, _, _) -> (_) %v6 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) - %v7 = "llvm.icmp.sgt" (%v5,%v6) : (_, _) -> (_) + %v7 = "llvm.icmp.sgt" (%v5,%v6) : (_, _) -> (i1) %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v9 = "llvm.sub" (%v8,%v5) : (_, _) -> (_) - %v10 = "llvm.select" (%v2,%A,%v4) : (_, _, _) -> (_) - "llvm.return" (%v10) : (_) -> () + %v10 = "llvm.select" (%v2,%A,%v4) : (i1, _, _) -> (i1) + "llvm.return" (%v10) : (i1) -> () }] -theorem alive_Select_740 (w : Nat) : alive_Select_740_src w ⊑ alive_Select_740_tgt w := by +theorem alive_Select_740 (w : Nat) : alive_Select_740_src w ⊑ alive_Select_740_tgt w := by unfold alive_Select_740_src alive_Select_740_tgt simp_alive_peephole apply bitvec_Select_740 @@ -3454,38 +3449,38 @@ theorem alive_Select_740 (w : Nat) : alive_Select_740_src w ⊑ alive_Select_7 %abs2 = select i1 %c, %minus, %A -/ -def alive_Select_741_src (w : Nat) := -[mlir_icom (w)| { +def alive_Select_741_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v2 = "llvm.icmp.sgt" (%A,%v1) : (_, _) -> (_) + %v2 = "llvm.icmp.sgt" (%A,%v1) : (_, _) -> (i1) %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v4 = "llvm.sub" (%v3,%A) : (_, _) -> (i1) - %v5 = "llvm.select" (%v2,%v4,%A) : (_, _, _) -> (_) + %v5 = "llvm.select" (%v2,%v4,%A) : (i1, _, _) -> (i1) %v6 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) - %v7 = "llvm.icmp.sgt" (%v5,%v6) : (_, _) -> (_) + %v7 = "llvm.icmp.sgt" (%v5,%v6) : (_, _) -> (i1) %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v9 = "llvm.sub" (%v8,%v5) : (_, _) -> (_) - %v10 = "llvm.select" (%v7,%v9,%v5) : (_, _, _) -> (_) - "llvm.return" (%v10) : (_) -> () + %v10 = "llvm.select" (%v7,%v9,%v5) : (i1, _, _) -> (i1) + "llvm.return" (%v10) : (i1) -> () }] -def alive_Select_741_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_Select_741_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v2 = "llvm.icmp.sgt" (%A,%v1) : (_, _) -> (_) + %v2 = "llvm.icmp.sgt" (%A,%v1) : (_, _) -> (i1) %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v4 = "llvm.sub" (%v3,%A) : (_, _) -> (i1) - %v5 = "llvm.select" (%v2,%v4,%A) : (_, _, _) -> (_) + %v5 = "llvm.select" (%v2,%v4,%A) : (i1, _, _) -> (_) %v6 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) - %v7 = "llvm.icmp.sgt" (%v5,%v6) : (_, _) -> (_) + %v7 = "llvm.icmp.sgt" (%v5,%v6) : (_, _) -> (i1) %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v9 = "llvm.sub" (%v8,%v5) : (_, _) -> (_) - %v10 = "llvm.select" (%v2,%v4,%A) : (_, _, _) -> (i1) + %v10 = "llvm.select" (%v2,%v4,%A) : (i1, _, _) -> (i1) "llvm.return" (%v10) : (i1) -> () }] -theorem alive_Select_741 : alive_Select_741_src ⊑ alive_Select_741_tgt := by +theorem alive_Select_741 (w : Nat) : alive_Select_741_src w ⊑ alive_Select_741_tgt w := by unfold alive_Select_741_src alive_Select_741_tgt simp_alive_peephole apply bitvec_Select_741 @@ -3511,40 +3506,40 @@ theorem alive_Select_741 : alive_Select_741_src ⊑ alive_Select_741_tgt := by %abs2 = select i1 %c3, %A, %minus -/ -def alive_Select_746_src (w : Nat) := -[mlir_icom (w)| { +def alive_Select_746_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v2 = "llvm.icmp.slt" (%A,%v1) : (_, _) -> (_) + %v2 = "llvm.icmp.slt" (%A,%v1) : (_, _) -> (i1) %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v4 = "llvm.sub" (%v3,%A) : (_, _) -> (_) - %v5 = "llvm.select" (%v2,%A,%v4) : (_, _, _) -> (_) + %v4 = "llvm.sub" (%v3,%A) : (_, _) -> (i1) + %v5 = "llvm.select" (%v2,%A,%v4) : (i1, _, _) -> (i1) %v6 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v7 = "llvm.icmp.sgt" (%v5,%v6) : (_, _) -> (_) + %v7 = "llvm.icmp.sgt" (%v5,%v6) : (_, _) -> (i1) %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v9 = "llvm.sub" (%v8,%v5) : (_, _) -> (_) - %v10 = "llvm.select" (%v7,%v5,%v9) : (_, _, _) -> (_) - "llvm.return" (%v10) : (_) -> () + %v10 = "llvm.select" (%v7,%v5,%v9) : (i1, _, _) -> (i1) + "llvm.return" (%v10) : (i1) -> () }] -def alive_Select_746_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_Select_746_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v2 = "llvm.sub" (%v1,%A) : (_, _) -> (_) + %v2 = "llvm.sub" (%v1,%A) : (_, _) -> (i1) %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v4 = "llvm.icmp.sgt" (%A,%v3) : (_, _) -> (_) + %v4 = "llvm.icmp.sgt" (%A,%v3) : (_, _) -> (i1) %v5 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v6 = "llvm.icmp.slt" (%A,%v5) : (_, _) -> (_) - %v7 = "llvm.select" (%v6,%A,%v2) : (_, _, _) -> (_) + %v6 = "llvm.icmp.slt" (%A,%v5) : (_, _) -> (i1) + %v7 = "llvm.select" (%v6,%A,%v2) : (i1, _, _) -> (_) %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v9 = "llvm.icmp.sgt" (%v7,%v8) : (_, _) -> (_) + %v9 = "llvm.icmp.sgt" (%v7,%v8) : (_, _) -> (i1) %v10 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v11 = "llvm.sub" (%v10,%v7) : (_, _) -> (_) - %v12 = "llvm.select" (%v4,%A,%v2) : (_, _, _) -> (_) - "llvm.return" (%v12) : (_) -> () + %v12 = "llvm.select" (%v4,%A,%v2) : (i1, _, _) -> (i1) + "llvm.return" (%v12) : (i1) -> () }] -theorem alive_Select_746 (w : Nat) : alive_Select_746_src w ⊑ alive_Select_746_tgt w := by +theorem alive_Select_746 (w : Nat) : alive_Select_746_src w ⊑ alive_Select_746_tgt w := by unfold alive_Select_746_src alive_Select_746_tgt simp_alive_peephole apply bitvec_Select_746 @@ -3570,40 +3565,40 @@ theorem alive_Select_746 (w : Nat) : alive_Select_746_src w ⊑ alive_Select_7 %abs2 = select i1 %c3, %A, %minus -/ -def alive_Select_747_src (w : Nat) := -[mlir_icom (w)| { +def alive_Select_747_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v2 = "llvm.icmp.sgt" (%A,%v1) : (_, _) -> (_) + %v2 = "llvm.icmp.sgt" (%A,%v1) : (_, _) -> (i1) %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v4 = "llvm.sub" (%v3,%A) : (_, _) -> (_) - %v5 = "llvm.select" (%v2,%A,%v4) : (_, _, _) -> (_) + %v4 = "llvm.sub" (%v3,%A) : (_, _) -> (i1) + %v5 = "llvm.select" (%v2,%A,%v4) : (i1, _, _) -> (i1) %v6 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v7 = "llvm.icmp.slt" (%v5,%v6) : (_, _) -> (_) + %v7 = "llvm.icmp.slt" (%v5,%v6) : (_, _) -> (i1) %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v9 = "llvm.sub" (%v8,%v5) : (_, _) -> (_) - %v10 = "llvm.select" (%v7,%v5,%v9) : (_, _, _) -> (_) - "llvm.return" (%v10) : (_) -> () + %v10 = "llvm.select" (%v7,%v5,%v9) : (i1, _, _) -> (i1) + "llvm.return" (%v10) : (i1) -> () }] -def alive_Select_747_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_Select_747_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%A : _): %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v2 = "llvm.sub" (%v1,%A) : (_, _) -> (_) + %v2 = "llvm.sub" (%v1,%A) : (_, _) -> (i1) %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v4 = "llvm.icmp.slt" (%A,%v3) : (_, _) -> (_) + %v4 = "llvm.icmp.slt" (%A,%v3) : (_, _) -> (i1) %v5 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v6 = "llvm.icmp.sgt" (%A,%v5) : (_, _) -> (_) - %v7 = "llvm.select" (%v6,%A,%v2) : (_, _, _) -> (_) + %v6 = "llvm.icmp.sgt" (%A,%v5) : (_, _) -> (i1) + %v7 = "llvm.select" (%v6,%A,%v2) : (i1, _, _) -> (_) %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v9 = "llvm.icmp.slt" (%v7,%v8) : (_, _) -> (_) + %v9 = "llvm.icmp.slt" (%v7,%v8) : (_, _) -> (i1) %v10 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v11 = "llvm.sub" (%v10,%v7) : (_, _) -> (_) - %v12 = "llvm.select" (%v4,%A,%v2) : (_, _, _) -> (_) - "llvm.return" (%v12) : (_) -> () + %v12 = "llvm.select" (%v4,%A,%v2) : (i1, _, _) -> (i1) + "llvm.return" (%v12) : (i1) -> () }] -theorem alive_Select_747 (w : Nat) : alive_Select_747_src w ⊑ alive_Select_747_tgt w := by +theorem alive_Select_747 (w : Nat) : alive_Select_747_src w ⊑ alive_Select_747_tgt w := by unfold alive_Select_747_src alive_Select_747_tgt simp_alive_peephole apply bitvec_Select_747 @@ -3620,8 +3615,8 @@ theorem alive_Select_747 (w : Nat) : alive_Select_747_src w ⊑ alive_Select_7 %r = and %nota, %b -/ -def alive_Select_858_src (w : Nat) := -[mlir_icom (w)| { +def alive_Select_858_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) @@ -3629,15 +3624,15 @@ def alive_Select_858_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def alive_Select_858_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_Select_858_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) %v3 = "llvm.and" (%v2,%b) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_Select_858 (w : Nat) : alive_Select_858_src w ⊑ alive_Select_858_tgt w := by +theorem alive_Select_858 (w : Nat) : alive_Select_858_src w ⊑ alive_Select_858_tgt w := by unfold alive_Select_858_src alive_Select_858_tgt simp_alive_peephole apply bitvec_Select_858 @@ -3654,8 +3649,8 @@ theorem alive_Select_858 (w : Nat) : alive_Select_858_src w ⊑ alive_Select_8 %r = or %nota, %b -/ -def alive_Select_859'_src (w : Nat) := -[mlir_icom (w)| { +def alive_Select_859'_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) @@ -3663,15 +3658,15 @@ def alive_Select_859'_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def alive_Select_859'_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_Select_859'_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%a : _, %b : _): %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) %v3 = "llvm.or" (%v2,%b) : (_, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_Select_859' (w : Nat) : alive_Select_859'_src w ⊑ alive_Select_859'_tgt w := by +theorem alive_Select_859' (w : Nat) : alive_Select_859'_src w ⊑ alive_Select_859'_tgt w := by unfold alive_Select_859'_src alive_Select_859'_tgt simp_alive_peephole apply bitvec_Select_859' @@ -3688,8 +3683,8 @@ theorem alive_Select_859' (w : Nat) : alive_Select_859'_src w ⊑ alive_Select %r = select i1 %val, %Y, %X -/ -def alive_Select_1087_src (w : Nat) := -[mlir_icom (w)| { +def alive_Select_1087_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%Y : _, %X : _, %val : _): %v1 = "llvm.mlir.constant" () { value = 1 : 1 } :() -> (i1) %v2 = "llvm.xor" (%val,%v1) : (_, i1) -> (i1) @@ -3697,15 +3692,15 @@ def alive_Select_1087_src (w : Nat) := "llvm.return" (%v3) : (_) -> () }] -def alive_Select_1087_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_Select_1087_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%Y : _, %X : _, %val : _): %v1 = "llvm.mlir.constant" () { value = 1 : 1 } :() -> (i1) %v2 = "llvm.xor" (%val,%v1) : (_, i1) -> (i1) %v3 = "llvm.select" (%val,%Y,%X) : (_, _, _) -> (_) "llvm.return" (%v3) : (_) -> () }] -theorem alive_Select_1087 (w : Nat) : alive_Select_1087_src w ⊑ alive_Select_1087_tgt w := by +theorem alive_Select_1087 (w : Nat) : alive_Select_1087_src w ⊑ alive_Select_1087_tgt w := by unfold alive_Select_1087_src alive_Select_1087_tgt simp_alive_peephole apply bitvec_Select_1087 @@ -3720,21 +3715,21 @@ theorem alive_Select_1087 (w : Nat) : alive_Select_1087_src w ⊑ alive_Select %r = %X -/ -def alive_Select_1100_src (w : Nat) := -[mlir_icom (w)| { +def alive_Select_1100_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%Y : _, %X : _): %v1 = "llvm.mlir.constant" () { value = 1 : 1 } :() -> (i1) %v2 = "llvm.select" (%v1,%X,%Y) : (i1, _, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -def alive_Select_1100_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_Select_1100_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%Y : _, %X : _): %v1 = "llvm.copy" (%X) : (_) -> (_) "llvm.return" (%v1) : (_) -> () }] -theorem alive_Select_1100 (w : Nat) : alive_Select_1100_src w ⊑ alive_Select_1100_tgt w := by +theorem alive_Select_1100 (w : Nat) : alive_Select_1100_src w ⊑ alive_Select_1100_tgt w := by unfold alive_Select_1100_src alive_Select_1100_tgt simp_alive_peephole apply bitvec_Select_1100 @@ -3749,21 +3744,21 @@ theorem alive_Select_1100 (w : Nat) : alive_Select_1100_src w ⊑ alive_Select %r = %Y -/ -def alive_Select_1105_src (w : Nat) := -[mlir_icom (w)| { +def alive_Select_1105_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%Y : _, %X : _): %v1 = "llvm.mlir.constant" () { value = 0 : 1 } :() -> (i1) %v2 = "llvm.select" (%v1,%X,%Y) : (i1, _, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -def alive_Select_1105_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_Select_1105_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%Y : _, %X : _): %v1 = "llvm.copy" (%Y) : (_) -> (_) "llvm.return" (%v1) : (_) -> () }] -theorem alive_Select_1105 (w : Nat) : alive_Select_1105_src w ⊑ alive_Select_1105_tgt w := by +theorem alive_Select_1105 (w : Nat) : alive_Select_1105_src w ⊑ alive_Select_1105_tgt w := by unfold alive_Select_1105_src alive_Select_1105_tgt simp_alive_peephole apply bitvec_Select_1105 @@ -3780,16 +3775,16 @@ theorem alive_Select_1105 (w : Nat) : alive_Select_1105_src w ⊑ alive_Select %r = and %X, (-1 u>> C) -/ -def alive_InstCombineShift__239_src (w : Nat) := -[mlir_icom (w)| { +def alive_InstCombineShift__239_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%X : _, %C : _): %v1 = "llvm.shl" (%X,%C) : (_, _) -> (_) %v2 = "llvm.lshr" (%v1,%C) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -def alive_InstCombineShift__239_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_InstCombineShift__239_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%X : _, %C : _): %v1 = "llvm.shl" (%X,%C) : (_, _) -> (_) %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -3797,7 +3792,7 @@ def alive_InstCombineShift__239_tgt (w : Nat):= %v4 = "llvm.and" (%X,%v3) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_InstCombineShift__239 (w : Nat) : alive_InstCombineShift__239_src w ⊑ alive_InstCombineShift__239_tgt w := by +theorem alive_InstCombineShift__239 (w : Nat) : alive_InstCombineShift__239_src w ⊑ alive_InstCombineShift__239_tgt w := by unfold alive_InstCombineShift__239_src alive_InstCombineShift__239_tgt simp_alive_peephole apply bitvec_InstCombineShift__239 @@ -3814,16 +3809,16 @@ theorem alive_InstCombineShift__239 (w : Nat) : alive_InstCombineShift__239_src %r = and %X, (-1 << C) -/ -def alive_InstCombineShift__279_src (w : Nat) := -[mlir_icom (w)| { +def alive_InstCombineShift__279_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%X : _, %C : _): %v1 = "llvm.lshr" (%X,%C) : (_, _) -> (_) %v2 = "llvm.shl" (%v1,%C) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -def alive_InstCombineShift__279_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_InstCombineShift__279_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%X : _, %C : _): %v1 = "llvm.lshr" (%X,%C) : (_, _) -> (_) %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -3831,7 +3826,7 @@ def alive_InstCombineShift__279_tgt (w : Nat):= %v4 = "llvm.and" (%X,%v3) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_InstCombineShift__279 (w : Nat) : alive_InstCombineShift__279_src w ⊑ alive_InstCombineShift__279_tgt w := by +theorem alive_InstCombineShift__279 (w : Nat) : alive_InstCombineShift__279_src w ⊑ alive_InstCombineShift__279_tgt w := by unfold alive_InstCombineShift__279_src alive_InstCombineShift__279_tgt simp_alive_peephole apply bitvec_InstCombineShift__279 @@ -3854,8 +3849,8 @@ theorem alive_InstCombineShift__279 (w : Nat) : alive_InstCombineShift__279_src %r = xor %a, %y2 -/ -def alive_InstCombineShift__440_src (w : Nat) := -[mlir_icom (w)| { +def alive_InstCombineShift__440_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%Y : _, %X : _, %C : _, %C2 : _): %v1 = "llvm.lshr" (%X,%C) : (_, _) -> (_) %v2 = "llvm.and" (%v1,%C2) : (_, _) -> (_) @@ -3864,8 +3859,8 @@ def alive_InstCombineShift__440_src (w : Nat) := "llvm.return" (%v4) : (_) -> () }] -def alive_InstCombineShift__440_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_InstCombineShift__440_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%Y : _, %X : _, %C : _, %C2 : _): %v1 = "llvm.shl" (%C2,%C) : (_, _) -> (_) %v2 = "llvm.and" (%X,%v1) : (_, _) -> (_) @@ -3876,7 +3871,7 @@ def alive_InstCombineShift__440_tgt (w : Nat):= %v7 = "llvm.xor" (%v2,%v3) : (_, _) -> (_) "llvm.return" (%v7) : (_) -> () }] -theorem alive_InstCombineShift__440 (w : Nat) : alive_InstCombineShift__440_src w ⊑ alive_InstCombineShift__440_tgt w := by +theorem alive_InstCombineShift__440 (w : Nat) : alive_InstCombineShift__440_src w ⊑ alive_InstCombineShift__440_tgt w := by unfold alive_InstCombineShift__440_src alive_InstCombineShift__440_tgt simp_alive_peephole apply bitvec_InstCombineShift__440 @@ -3899,8 +3894,8 @@ theorem alive_InstCombineShift__440 (w : Nat) : alive_InstCombineShift__440_src %r = or %a, %s2 -/ -def alive_InstCombineShift__476_src (w : Nat) := -[mlir_icom (w)| { +def alive_InstCombineShift__476_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%Y : _, %X : _, %C : _, %C2 : _): %v1 = "llvm.lshr" (%X,%C) : (_, _) -> (_) %v2 = "llvm.and" (%v1,%C2) : (_, _) -> (_) @@ -3909,8 +3904,8 @@ def alive_InstCombineShift__476_src (w : Nat) := "llvm.return" (%v4) : (_) -> () }] -def alive_InstCombineShift__476_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_InstCombineShift__476_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%Y : _, %X : _, %C : _, %C2 : _): %v1 = "llvm.shl" (%Y,%C) : (_, _) -> (_) %v2 = "llvm.shl" (%C2,%C) : (_, _) -> (_) @@ -3921,7 +3916,7 @@ def alive_InstCombineShift__476_tgt (w : Nat):= %v7 = "llvm.or" (%v3,%v1) : (_, _) -> (_) "llvm.return" (%v7) : (_) -> () }] -theorem alive_InstCombineShift__476 (w : Nat) : alive_InstCombineShift__476_src w ⊑ alive_InstCombineShift__476_tgt w := by +theorem alive_InstCombineShift__476 (w : Nat) : alive_InstCombineShift__476_src w ⊑ alive_InstCombineShift__476_tgt w := by unfold alive_InstCombineShift__476_src alive_InstCombineShift__476_tgt simp_alive_peephole apply bitvec_InstCombineShift__476 @@ -3939,16 +3934,16 @@ theorem alive_InstCombineShift__476 (w : Nat) : alive_InstCombineShift__476_src %r = xor %s2, (C2 u>> C) -/ -def alive_InstCombineShift__497_src (w : Nat) := -[mlir_icom (w)| { +def alive_InstCombineShift__497_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%X : _, %C : _, %C2 : _): %v1 = "llvm.xor" (%X,%C2) : (_, _) -> (_) %v2 = "llvm.lshr" (%v1,%C) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -def alive_InstCombineShift__497_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_InstCombineShift__497_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%X : _, %C : _, %C2 : _): %v1 = "llvm.lshr" (%X,%C) : (_, _) -> (_) %v2 = "llvm.xor" (%X,%C2) : (_, _) -> (_) @@ -3956,7 +3951,7 @@ def alive_InstCombineShift__497_tgt (w : Nat):= %v4 = "llvm.xor" (%v1,%v3) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_InstCombineShift__497 (w : Nat) : alive_InstCombineShift__497_src w ⊑ alive_InstCombineShift__497_tgt w := by +theorem alive_InstCombineShift__497 (w : Nat) : alive_InstCombineShift__497_src w ⊑ alive_InstCombineShift__497_tgt w := by unfold alive_InstCombineShift__497_src alive_InstCombineShift__497_tgt simp_alive_peephole apply bitvec_InstCombineShift__497 @@ -3974,16 +3969,16 @@ theorem alive_InstCombineShift__497 (w : Nat) : alive_InstCombineShift__497_src %r = add %s2, (C2 << C) -/ -def alive_InstCombineShift__497'''_src (w : Nat) := -[mlir_icom (w)| { +def alive_InstCombineShift__497'''_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%X : _, %C : _, %C2 : _): %v1 = "llvm.add" (%X,%C2) : (_, _) -> (_) %v2 = "llvm.shl" (%v1,%C) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -def alive_InstCombineShift__497'''_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_InstCombineShift__497'''_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%X : _, %C : _, %C2 : _): %v1 = "llvm.shl" (%X,%C) : (_, _) -> (_) %v2 = "llvm.add" (%X,%C2) : (_, _) -> (_) @@ -3991,7 +3986,7 @@ def alive_InstCombineShift__497'''_tgt (w : Nat):= %v4 = "llvm.add" (%v1,%v3) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_InstCombineShift__497''' (w : Nat) : alive_InstCombineShift__497'''_src w ⊑ alive_InstCombineShift__497'''_tgt w := by +theorem alive_InstCombineShift__497''' (w : Nat) : alive_InstCombineShift__497'''_src w ⊑ alive_InstCombineShift__497'''_tgt w := by unfold alive_InstCombineShift__497'''_src alive_InstCombineShift__497'''_tgt simp_alive_peephole apply bitvec_InstCombineShift__497''' @@ -4008,16 +4003,16 @@ theorem alive_InstCombineShift__497''' (w : Nat) : alive_InstCombineShift__497' %r = and %X, (-1 u>> C) -/ -def alive_InstCombineShift__582_src (w : Nat) := -[mlir_icom (w)| { +def alive_InstCombineShift__582_src (w : Nat) := +[mlir_icom ( w )| { ^bb0(%X : _, %C : _): %v1 = "llvm.shl" (%X,%C) : (_, _) -> (_) %v2 = "llvm.lshr" (%v1,%C) : (_, _) -> (_) "llvm.return" (%v2) : (_) -> () }] -def alive_InstCombineShift__582_tgt (w : Nat):= -[mlir_icom (w)| { +def alive_InstCombineShift__582_tgt (w : Nat) := +[mlir_icom ( w )| { ^bb0(%X : _, %C : _): %v1 = "llvm.shl" (%X,%C) : (_, _) -> (_) %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) @@ -4025,7 +4020,7 @@ def alive_InstCombineShift__582_tgt (w : Nat):= %v4 = "llvm.and" (%X,%v3) : (_, _) -> (_) "llvm.return" (%v4) : (_) -> () }] -theorem alive_InstCombineShift__582 (w : Nat) : alive_InstCombineShift__582_src w ⊑ alive_InstCombineShift__582_tgt w := by +theorem alive_InstCombineShift__582 (w : Nat) : alive_InstCombineShift__582_src w ⊑ alive_InstCombineShift__582_tgt w := by unfold alive_InstCombineShift__582_src alive_InstCombineShift__582_tgt simp_alive_peephole apply bitvec_InstCombineShift__582 diff --git a/SSA/Projects/InstCombine/LLVM/Transform.lean b/SSA/Projects/InstCombine/LLVM/Transform.lean index f4aa26008..ccf250131 100644 --- a/SSA/Projects/InstCombine/LLVM/Transform.lean +++ b/SSA/Projects/InstCombine/LLVM/Transform.lean @@ -388,6 +388,20 @@ def TypedSSAVal.newVal (Γ : Context φ) : TypedSSAVal φ → def mkExpr (Γ : Context φ) (opStx : Op φ) : ReaderM (Σ ty, Expr Γ ty) := do match opStx.args with + | v₁Stx::v₂Stx::v₃Stx::[] => + let ⟨.bitvec w₁, v₁⟩ ← TypedSSAVal.mkVal Γ v₁Stx + let ⟨.bitvec w₂, v₂⟩ ← TypedSSAVal.mkVal Γ v₂Stx + let ⟨.bitvec w₃, v₃⟩ ← TypedSSAVal.mkVal Γ v₃Stx + match opStx.name with + | "llvm.select" => + if hw1 : w₁ = 1 then + if hw23 : w₂ = w₃ then + let selectOp ← mkSelect (MOp.select w₂) (hw1 ▸ v₁) v₂ (hw23 ▸ v₃) + return ⟨.bitvec w₂, selectOp⟩ + else + throw <| .widthError w₁ w₂ -- s!"mismatched types {ty₁} ≠ {ty₂} in binary op" + else throw <| .unsupportedOp s!"expected select condtion to have width 1, found width '{w₁}'" + | op => throw <| .unsupportedOp s!"Unsuported ternary operation or invalid arguments '{op}'" | v₁Stx::v₂Stx::[] => let ⟨.bitvec w₁, v₁⟩ ← TypedSSAVal.mkVal Γ v₁Stx let ⟨.bitvec w₂, v₂⟩ ← TypedSSAVal.mkVal Γ v₂Stx @@ -401,7 +415,6 @@ def mkExpr (Γ : Context φ) (opStx : Op φ) : ReaderM (Σ ty, Expr Γ ty) := do | "llvm.ashr" => pure (MOp.ashr w₁) | "llvm.urem" => pure (MOp.urem w₁) | "llvm.srem" => pure (MOp.srem w₁) - | "llvm.select" => pure (MOp.select w₁) | "llvm.add" => pure (MOp.add w₁) | "llvm.mul" => pure (MOp.mul w₁) | "llvm.sub" => pure (MOp.sub w₁) @@ -417,7 +430,7 @@ def mkExpr (Γ : Context φ) (opStx : Op φ) : ReaderM (Σ ty, Expr Γ ty) := do | "llvm.icmp.sge" => pure (MOp.icmp InstCombine.IntPredicate.sge w₁) | "llvm.icmp.slt" => pure (MOp.icmp InstCombine.IntPredicate.slt w₁) | "llvm.icmp.sle" => pure (MOp.icmp InstCombine.IntPredicate.sle w₁) - | opstr => throw <| .unsupportedOp s!"Unsuported operation or invalid arguments '{opstr}'" + | opstr => throw <| .unsupportedOp s!"Unsuported binary operation or invalid arguments '{opstr}'" match op with | .icmp .. => if hty : w₁ = w₂ then @@ -436,6 +449,7 @@ def mkExpr (Γ : Context φ) (opStx : Op φ) : ReaderM (Σ ty, Expr Γ ty) := do let op ← match opStx.name with | "llvm.not" => pure <| MOp.not w | "llvm.neg" => pure <| MOp.neg w + | "llvm.copy" => pure <| MOp.copy w | _ => throw <| .generic s!"Unknown (unary) operation syntax {opStx.name}" let op ← mkUnaryOp op v return ⟨.bitvec w, op⟩ From 4238f6f91b583eab0fcef09a63ebdcc30390cc65 Mon Sep 17 00:00:00 2001 From: Siddharth Bhat Date: Wed, 1 Nov 2023 16:03:18 +0000 Subject: [PATCH 08/12] feat: add working version of AliveAutoGenerated, with code that doesn't yet work 'sorry'd out --- SSA/Projects/InstCombine/Alive.lean | 7 +- .../InstCombine/AliveAutoGenerated.lean | 368 +++++++++--------- SSA/Projects/InstCombine/Tactic.lean | 16 +- 3 files changed, 203 insertions(+), 188 deletions(-) diff --git a/SSA/Projects/InstCombine/Alive.lean b/SSA/Projects/InstCombine/Alive.lean index 2fd53d078..ff5b4ce28 100644 --- a/SSA/Projects/InstCombine/Alive.lean +++ b/SSA/Projects/InstCombine/Alive.lean @@ -1,8 +1,11 @@ -- Auto generated alive statements -import SSA.Projects.InstCombine.AliveAutoGenerated +-- Do not import these into the default tree, because they take a long +-- time to elaborate and typecheck. +-- import SSA.Projects.InstCombine.AliveAutoGenerated --- Pure math statements needed to proof alive statements +-- Pure math statements needed to prove alive statements. +-- Include these, as they are reasonably fast to typecheck. import SSA.Projects.InstCombine.AliveStatements -- The semantics for the MLIR base dialect diff --git a/SSA/Projects/InstCombine/AliveAutoGenerated.lean b/SSA/Projects/InstCombine/AliveAutoGenerated.lean index fdda63d08..a89a157fc 100644 --- a/SSA/Projects/InstCombine/AliveAutoGenerated.lean +++ b/SSA/Projects/InstCombine/AliveAutoGenerated.lean @@ -1,3 +1,4 @@ + import SSA.Projects.InstCombine.LLVM.EDSL import SSA.Projects.InstCombine.AliveStatements import SSA.Projects.InstCombine.Refinement @@ -12,6 +13,7 @@ set_option pp.proofs false set_option pp.proofs.withType false + -- Name:AddSub:1043 -- precondition: true /- @@ -1308,7 +1310,7 @@ def alive_AndOrXor_1683_2_tgt (w : Nat) := ^bb0(%a : _, %b : _): %v1 = "llvm.icmp.uge" (%a,%b) : (_, _) -> (i1) %v2 = "llvm.icmp.ne" (%a,%b) : (_, _) -> (i1) - %v3 = "llvm.mlir.constant" () { value = 1 : 1 } :() -> (i1) + %v3 = "llvm.mlir.constant" () { value = 1 : i1 } :() -> (i1) %v4 = "llvm.copy" (%v3) : (i1) -> (i1) "llvm.return" (%v4) : (i1) -> () }] @@ -2249,8 +2251,8 @@ def alive_AndOrXor_2453_src (w : Nat) := [mlir_icom ( w )| { ^bb0(%y : _, %x : _): %v1 = "llvm.icmp.slt" (%x,%y) : (_, _) -> (i1) - %v2 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) - %v3 = "llvm.xor" (%v1,%v2) : (i1, _) -> (i1) + %v2 = "llvm.mlir.constant" () { value = -1 : i1 } :() -> (_) + %v3 = "llvm.xor" (%v1,%v2) : (i1, i1) -> (i1) "llvm.return" (%v3) : (i1) -> () }] @@ -2836,8 +2838,8 @@ def alive_275_tgt := theorem alive_275 : alive_275_src ⊑ alive_275_tgt := by unfold alive_275_src alive_275_tgt simp_alive_peephole - apply bitvec_275 - + -- apply bitvec_275 + sorry -- Name:275-2 -- precondition: true @@ -2870,8 +2872,8 @@ def alive_275_2_tgt := theorem alive_275_2 : alive_275_2_src ⊑ alive_275_2_tgt := by unfold alive_275_2_src alive_275_2_tgt simp_alive_peephole - apply bitvec_275_2 - + -- apply bitvec_275_2 + sorry -- Name:276 -- precondition: true @@ -2891,8 +2893,8 @@ def alive_276_src (w : Nat) := [mlir_icom ( w )| { ^bb0(%Y : i5, %X : i5): %v1 = "llvm.sdiv" (%X,%Y) : (i5, i5) -> (i5) - %v2 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v3 = "llvm.sub" (%v2,%Y) : (_, i5) -> (i5) + %v2 = "llvm.mlir.constant" () { value = 0 : i5 } :() -> (_) + %v3 = "llvm.sub" (%v2,%Y) : (i5, i5) -> (i5) %v4 = "llvm.mul" (%v1,%v3) : (i5, i5) -> (i5) "llvm.return" (%v4) : (i5) -> () }] @@ -2902,15 +2904,16 @@ def alive_276_tgt (w : Nat) := ^bb0(%Y : i5, %X : i5): %v1 = "llvm.srem" (%X,%Y) : (i5, i5) -> (i5) %v2 = "llvm.sdiv" (%X,%Y) : (i5, i5) -> (i5) - %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v4 = "llvm.sub" (%v3,%Y) : (_, i5) -> (i5) + %v3 = "llvm.mlir.constant" () { value = 0 : i5 } :() -> (_) + %v4 = "llvm.sub" (%v3,%Y) : (i5, i5) -> (i5) %v5 = "llvm.sub" (%v1,%X) : (i5, i5) -> (i5) "llvm.return" (%v5) : (i5) -> () }] theorem alive_276 (w : Nat) : alive_276_src w ⊑ alive_276_tgt w := by unfold alive_276_src alive_276_tgt simp_alive_peephole - apply bitvec_276 + sorry + -- apply bitvec_276 -- Name:276-2 @@ -2931,8 +2934,8 @@ def alive_276_2_src (w : Nat) := [mlir_icom ( w )| { ^bb0(%Y : i5, %X : i5): %v1 = "llvm.udiv" (%X,%Y) : (i5, i5) -> (i5) - %v2 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v3 = "llvm.sub" (%v2,%Y) : (_, i5) -> (i5) + %v2 = "llvm.mlir.constant" () { value = 0 : i5 } :() -> (_) + %v3 = "llvm.sub" (%v2,%Y) : (i5, i5) -> (i5) %v4 = "llvm.mul" (%v1,%v3) : (i5, i5) -> (i5) "llvm.return" (%v4) : (i5) -> () }] @@ -2942,8 +2945,8 @@ def alive_276_2_tgt (w : Nat) := ^bb0(%Y : i5, %X : i5): %v1 = "llvm.urem" (%X,%Y) : (i5, i5) -> (i5) %v2 = "llvm.udiv" (%X,%Y) : (i5, i5) -> (i5) - %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v4 = "llvm.sub" (%v3,%Y) : (_, i5) -> (i5) + %v3 = "llvm.mlir.constant" () { value = 0 : i5 } :() -> (_) + %v4 = "llvm.sub" (%v3,%Y) : (i5, i5) -> (i5) %v5 = "llvm.sub" (%v1,%X) : (i5, i5) -> (i5) "llvm.return" (%v5) : (i5) -> () }] @@ -3048,7 +3051,8 @@ def alive_805_tgt (w : Nat) := theorem alive_805 (w : Nat) : alive_805_src w ⊑ alive_805_tgt w := by unfold alive_805_src alive_805_tgt simp_alive_peephole - apply bitvec_805 + sorry + -- apply bitvec_805 -- Name:820 @@ -3084,7 +3088,8 @@ def alive_820_tgt := theorem alive_820 : alive_820_src ⊑ alive_820_tgt := by unfold alive_820_src alive_820_tgt simp_alive_peephole - apply bitvec_820 + sorry + -- apply bitvec_820 -- Name:820' @@ -3181,8 +3186,9 @@ def alive_Select_637_tgt (w : Nat) := }] theorem alive_Select_637 (w : Nat) : alive_Select_637_src w ⊑ alive_Select_637_tgt w := by unfold alive_Select_637_src alive_Select_637_tgt - simp_alive_peephole - apply bitvec_Select_637 + simp_alive_peephole <;> sorry + -- simp[HVector.toTriple, HVector.toTuple] + -- apply bitvec_Select_637 -- Name:Select:641 @@ -3213,8 +3219,10 @@ def alive_Select_641_tgt (w : Nat) := }] theorem alive_Select_641 (w : Nat) : alive_Select_641_src w ⊑ alive_Select_641_tgt w := by unfold alive_Select_641_src alive_Select_641_tgt - simp_alive_peephole - apply bitvec_Select_641 + simp_alive_peephole <;> sorry + -- toTriple + -- apply bitvec_Select_641 + -- Name:Select:699 @@ -3236,10 +3244,10 @@ def alive_Select_699_src (w : Nat) := [mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.icmp.uge" (%A,%B) : (_, _) -> (i1) - %v2 = "llvm.select" (%v1,%A,%B) : (i1, _, _) -> (i1) + %v2 = "llvm.select" (%v1,%A,%B) : (i1, _, _) -> (_) %v3 = "llvm.icmp.uge" (%v2,%B) : (_, _) -> (i1) - %v4 = "llvm.select" (%v3,%v2,%B) : (i1, _, _) -> (i1) - "llvm.return" (%v4) : (i1) -> () + %v4 = "llvm.select" (%v3,%v2,%B) : (i1, _, _) -> (_) + "llvm.return" (%v4) : (_) -> () }] def alive_Select_699_tgt (w : Nat) := @@ -3248,14 +3256,13 @@ def alive_Select_699_tgt (w : Nat) := %v1 = "llvm.icmp.uge" (%A,%B) : (_, _) -> (i1) %v2 = "llvm.select" (%v1,%A,%B) : (i1, _, _) -> (_) %v3 = "llvm.icmp.uge" (%v2,%B) : (_, _) -> (i1) - %v4 = "llvm.select" (%v1,%A,%B) : (i1, _, _) -> (i1) - "llvm.return" (%v4) : (i1) -> () + %v4 = "llvm.select" (%v1,%A,%B) : (i1, _, _) -> (_) + "llvm.return" (%v4) : (_) -> () }] theorem alive_Select_699 (w : Nat) : alive_Select_699_src w ⊑ alive_Select_699_tgt w := by unfold alive_Select_699_src alive_Select_699_tgt - simp_alive_peephole - apply bitvec_Select_699 - + simp_alive_peephole <;> sorry + done -- Name:Select:700 -- precondition: true @@ -3274,9 +3281,12 @@ theorem alive_Select_699 (w : Nat) : alive_Select_699_src w ⊑ alive_Select -/ def alive_Select_700_src (w : Nat) := [mlir_icom ( w )| { -^bb0(%A : _, %B : _, %C : i1): - %v4 = "llvm.select" (%C, %A, %B) : (i1, _, _) -> (i1) - "llvm.return" (%v4) : (i1) -> () +^bb0(%A : _, %B : _): + %v1 = "llvm.icmp.slt" (%A,%B) : (_, _) -> (i1) + %v2 = "llvm.select" (%v1,%A,%B) : (i1, _, _) -> (_) + %v3 = "llvm.icmp.slt" (%v2,%B) : (_, _) -> (i1) + %v4 = "llvm.select" (%v3,%v2,%B) : (i1, _, _) -> (_) + "llvm.return" (%v4) : (_) -> () }] def alive_Select_700_tgt (w : Nat) := @@ -3285,14 +3295,15 @@ def alive_Select_700_tgt (w : Nat) := %v1 = "llvm.icmp.slt" (%A,%B) : (_, _) -> (i1) %v2 = "llvm.select" (%v1,%A,%B) : (i1, _, _) -> (_) %v3 = "llvm.icmp.slt" (%v2,%B) : (_, _) -> (i1) - %v4 = "llvm.select" (%v1,%A,%B) : (i1, _, _) -> (i1) - "llvm.return" (%v4) : (i1) -> () + %v4 = "llvm.select" (%v1,%A,%B) : (i1, _, _) -> (_) + "llvm.return" (%v4) : (_) -> () }] theorem alive_Select_700 (w : Nat) : alive_Select_700_src w ⊑ alive_Select_700_tgt w := by unfold alive_Select_700_src alive_Select_700_tgt - simp_alive_peephole - apply bitvec_Select_700 - + simp_alive_peephole <;> sorry + -- toTriple + -- apply bitvec_Select_700 + done -- Name:Select:704 -- precondition: true @@ -3313,10 +3324,10 @@ def alive_Select_704_src (w : Nat) := [mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.icmp.slt" (%A,%B) : (_, _) -> (i1) - %v2 = "llvm.select" (%v1,%A,%B) : (i1, _, _) -> (i1) + %v2 = "llvm.select" (%v1,%A,%B) : (i1, _, _) -> (_) %v3 = "llvm.icmp.sge" (%v2,%A) : (_, _) -> (i1) - %v4 = "llvm.select" (%v3,%v2,%A) : (i1, _, _) -> (i1) - "llvm.return" (%v4) : (i1) -> () + %v4 = "llvm.select" (%v3,%v2,%A) : (i1, _, _) -> (_) + "llvm.return" (%v4) : (_) -> () }] def alive_Select_704_tgt (w : Nat) := @@ -3326,12 +3337,13 @@ def alive_Select_704_tgt (w : Nat) := %v2 = "llvm.select" (%v1,%A,%B) : (i1, _, _) -> (_) %v3 = "llvm.icmp.sge" (%v2,%A) : (_, _) -> (i1) %v4 = "llvm.copy" (%A) : (_) -> (i1) - "llvm.return" (%v4) : (i1) -> () + "llvm.return" (%v4) : (_) -> () }] theorem alive_Select_704 (w : Nat) : alive_Select_704_src w ⊑ alive_Select_704_tgt w := by unfold alive_Select_704_src alive_Select_704_tgt - simp_alive_peephole - apply bitvec_Select_704 + simp_alive_peephole <;> sorry + -- apply bitvec_Select_704 + done -- Name:Select:705 @@ -3353,10 +3365,10 @@ def alive_Select_705_src (w : Nat) := [mlir_icom ( w )| { ^bb0(%A : _, %B : _): %v1 = "llvm.icmp.sge" (%A,%B) : (_, _) -> (i1) - %v2 = "llvm.select" (%v1,%A,%B) : (i1, _, _) -> (i1) + %v2 = "llvm.select" (%v1,%A,%B) : (i1, _, _) -> (_) %v3 = "llvm.icmp.slt" (%v2,%A) : (_, _) -> (i1) - %v4 = "llvm.select" (%v3,%v2,%A) : (i1, _, _) -> (i1) - "llvm.return" (%v4) : (i1) -> () + %v4 = "llvm.select" (%v3,%v2,%A) : (i1, _, _) -> (_) + "llvm.return" (%v4) : (_) -> () }] def alive_Select_705_tgt (w : Nat) := @@ -3365,13 +3377,13 @@ def alive_Select_705_tgt (w : Nat) := %v1 = "llvm.icmp.sge" (%A,%B) : (_, _) -> (i1) %v2 = "llvm.select" (%v1,%A,%B) : (i1, _, _) -> (_) %v3 = "llvm.icmp.slt" (%v2,%A) : (_, _) -> (i1) - %v4 = "llvm.copy" (%A) : (_) -> (i1) - "llvm.return" (%v4) : (i1) -> () + %v4 = "llvm.copy" (%A) : (_) -> (_) + "llvm.return" (%v4) : (_) -> () }] theorem alive_Select_705 (w : Nat) : alive_Select_705_src w ⊑ alive_Select_705_tgt w := by unfold alive_Select_705_src alive_Select_705_tgt - simp_alive_peephole - apply bitvec_Select_705 + simp_alive_peephole <;> sorry + -- apply bitvec_Select_705 -- Name:Select:740 @@ -3400,13 +3412,13 @@ def alive_Select_740_src (w : Nat) := %v2 = "llvm.icmp.sgt" (%A,%v1) : (_, _) -> (i1) %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v4 = "llvm.sub" (%v3,%A) : (_, _) -> (i1) - %v5 = "llvm.select" (%v2,%A,%v4) : (i1, _, _) -> (i1) + %v5 = "llvm.select" (%v2,%A,%v4) : (i1, _, _) -> (_) %v6 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) %v7 = "llvm.icmp.sgt" (%v5,%v6) : (_, _) -> (i1) %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v9 = "llvm.sub" (%v8,%v5) : (_, _) -> (_) - %v10 = "llvm.select" (%v7,%v5,%v9) : (i1, _, _) -> (i1) - "llvm.return" (%v10) : (i1) -> () + %v10 = "llvm.select" (%v7,%v5,%v9) : (i1, _, _) -> (_) + "llvm.return" (%v10) : (_) -> () }] def alive_Select_740_tgt (w : Nat) := @@ -3421,13 +3433,13 @@ def alive_Select_740_tgt (w : Nat) := %v7 = "llvm.icmp.sgt" (%v5,%v6) : (_, _) -> (i1) %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v9 = "llvm.sub" (%v8,%v5) : (_, _) -> (_) - %v10 = "llvm.select" (%v2,%A,%v4) : (i1, _, _) -> (i1) - "llvm.return" (%v10) : (i1) -> () + %v10 = "llvm.select" (%v2,%A,%v4) : (i1, _, _) -> (_) + "llvm.return" (%v10) : (_) -> () }] theorem alive_Select_740 (w : Nat) : alive_Select_740_src w ⊑ alive_Select_740_tgt w := by unfold alive_Select_740_src alive_Select_740_tgt - simp_alive_peephole - apply bitvec_Select_740 + simp_alive_peephole <;> sorry + -- apply bitvec_Select_740 -- Name:Select:741 @@ -3461,8 +3473,8 @@ def alive_Select_741_src (w : Nat) := %v7 = "llvm.icmp.sgt" (%v5,%v6) : (_, _) -> (i1) %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v9 = "llvm.sub" (%v8,%v5) : (_, _) -> (_) - %v10 = "llvm.select" (%v7,%v9,%v5) : (i1, _, _) -> (i1) - "llvm.return" (%v10) : (i1) -> () + %v10 = "llvm.select" (%v7,%v9,%v5) : (i1, _, _) -> (_) + "llvm.return" (%v10) : (_) -> () }] def alive_Select_741_tgt (w : Nat) := @@ -3477,13 +3489,13 @@ def alive_Select_741_tgt (w : Nat) := %v7 = "llvm.icmp.sgt" (%v5,%v6) : (_, _) -> (i1) %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v9 = "llvm.sub" (%v8,%v5) : (_, _) -> (_) - %v10 = "llvm.select" (%v2,%v4,%A) : (i1, _, _) -> (i1) - "llvm.return" (%v10) : (i1) -> () + %v10 = "llvm.select" (%v2,%v4,%A) : (i1, _, _) -> (_) + "llvm.return" (%v10) : (_) -> () }] theorem alive_Select_741 (w : Nat) : alive_Select_741_src w ⊑ alive_Select_741_tgt w := by unfold alive_Select_741_src alive_Select_741_tgt - simp_alive_peephole - apply bitvec_Select_741 + simp_alive_peephole <;> sorry + -- apply bitvec_Select_741 -- Name:Select:746 @@ -3513,13 +3525,13 @@ def alive_Select_746_src (w : Nat) := %v2 = "llvm.icmp.slt" (%A,%v1) : (_, _) -> (i1) %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v4 = "llvm.sub" (%v3,%A) : (_, _) -> (i1) - %v5 = "llvm.select" (%v2,%A,%v4) : (i1, _, _) -> (i1) + %v5 = "llvm.select" (%v2,%A,%v4) : (i1, _, _) -> (_) %v6 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v7 = "llvm.icmp.sgt" (%v5,%v6) : (_, _) -> (i1) %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v9 = "llvm.sub" (%v8,%v5) : (_, _) -> (_) - %v10 = "llvm.select" (%v7,%v5,%v9) : (i1, _, _) -> (i1) - "llvm.return" (%v10) : (i1) -> () + %v10 = "llvm.select" (%v7,%v5,%v9) : (i1, _, _) -> (_) + "llvm.return" (%v10) : (_) -> () }] def alive_Select_746_tgt (w : Nat) := @@ -3536,14 +3548,14 @@ def alive_Select_746_tgt (w : Nat) := %v9 = "llvm.icmp.sgt" (%v7,%v8) : (_, _) -> (i1) %v10 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) %v11 = "llvm.sub" (%v10,%v7) : (_, _) -> (_) - %v12 = "llvm.select" (%v4,%A,%v2) : (i1, _, _) -> (i1) - "llvm.return" (%v12) : (i1) -> () + %v12 = "llvm.select" (%v4,%A,%v2) : (i1, _, _) -> (_) + "llvm.return" (%v12) : (_) -> () }] theorem alive_Select_746 (w : Nat) : alive_Select_746_src w ⊑ alive_Select_746_tgt w := by unfold alive_Select_746_src alive_Select_746_tgt - simp_alive_peephole - apply bitvec_Select_746 - + simp_alive_peephole <;> sorry + -- apply bitvec_Select_746 + -- sorry -- Name:Select:747 -- precondition: true @@ -3565,43 +3577,43 @@ theorem alive_Select_746 (w : Nat) : alive_Select_746_src w ⊑ alive_Select %abs2 = select i1 %c3, %A, %minus -/ -def alive_Select_747_src (w : Nat) := -[mlir_icom ( w )| { -^bb0(%A : _): - %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v2 = "llvm.icmp.sgt" (%A,%v1) : (_, _) -> (i1) - %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v4 = "llvm.sub" (%v3,%A) : (_, _) -> (i1) - %v5 = "llvm.select" (%v2,%A,%v4) : (i1, _, _) -> (i1) - %v6 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v7 = "llvm.icmp.slt" (%v5,%v6) : (_, _) -> (i1) - %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v9 = "llvm.sub" (%v8,%v5) : (_, _) -> (_) - %v10 = "llvm.select" (%v7,%v5,%v9) : (i1, _, _) -> (i1) - "llvm.return" (%v10) : (i1) -> () -}] - -def alive_Select_747_tgt (w : Nat) := -[mlir_icom ( w )| { -^bb0(%A : _): - %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v2 = "llvm.sub" (%v1,%A) : (_, _) -> (i1) - %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v4 = "llvm.icmp.slt" (%A,%v3) : (_, _) -> (i1) - %v5 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v6 = "llvm.icmp.sgt" (%A,%v5) : (_, _) -> (i1) - %v7 = "llvm.select" (%v6,%A,%v2) : (i1, _, _) -> (_) - %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v9 = "llvm.icmp.slt" (%v7,%v8) : (_, _) -> (i1) - %v10 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) - %v11 = "llvm.sub" (%v10,%v7) : (_, _) -> (_) - %v12 = "llvm.select" (%v4,%A,%v2) : (i1, _, _) -> (i1) - "llvm.return" (%v12) : (i1) -> () -}] -theorem alive_Select_747 (w : Nat) : alive_Select_747_src w ⊑ alive_Select_747_tgt w := by - unfold alive_Select_747_src alive_Select_747_tgt - simp_alive_peephole - apply bitvec_Select_747 +-- def alive_Select_747_src (w : Nat) := +-- [mlir_icom ( w )| { +-- ^bb0(%A : _): +-- %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) +-- %v2 = "llvm.icmp.sgt" (%A,%v1) : (_, _) -> (i1) +-- %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) +-- %v4 = "llvm.sub" (%v3,%A) : (_, _) -> (i1) +-- %v5 = "llvm.select" (%v2,%A,%v4) : (i1, _, _) -> (i1) +-- %v6 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) +-- %v7 = "llvm.icmp.slt" (%v5,%v6) : (_, _) -> (i1) +-- %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) +-- %v9 = "llvm.sub" (%v8,%v5) : (_, _) -> (_) +-- %v10 = "llvm.select" (%v7,%v5,%v9) : (i1, _, _) -> (i1) +-- "llvm.return" (%v10) : (i1) -> () +-- }] + +-- def alive_Select_747_tgt (w : Nat) := +-- [mlir_icom ( w )| { +-- ^bb0(%A : _): +-- %v1 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) +-- %v2 = "llvm.sub" (%v1,%A) : (_, _) -> (i1) +-- %v3 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) +-- %v4 = "llvm.icmp.slt" (%A,%v3) : (_, _) -> (i1) +-- %v5 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) +-- %v6 = "llvm.icmp.sgt" (%A,%v5) : (_, _) -> (i1) +-- %v7 = "llvm.select" (%v6,%A,%v2) : (i1, _, _) -> (_) +-- %v8 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) +-- %v9 = "llvm.icmp.slt" (%v7,%v8) : (_, _) -> (i1) +-- %v10 = "llvm.mlir.constant" () { value = 0 : _ } :() -> (_) +-- %v11 = "llvm.sub" (%v10,%v7) : (_, _) -> (_) +-- %v12 = "llvm.select" (%v4,%A,%v2) : (i1, _, _) -> (i1) +-- "llvm.return" (%v12) : (i1) -> () +-- }] +-- theorem alive_Select_747 (w : Nat) : alive_Select_747_src w ⊑ alive_Select_747_tgt w := by +-- unfold alive_Select_747_src alive_Select_747_tgt +-- simp_alive_peephole +-- apply bitvec_Select_747 -- Name:Select:858 @@ -3615,27 +3627,27 @@ theorem alive_Select_747 (w : Nat) : alive_Select_747_src w ⊑ alive_Select %r = and %nota, %b -/ -def alive_Select_858_src (w : Nat) := -[mlir_icom ( w )| { -^bb0(%a : _, %b : _): - %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) - %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) - %v3 = "llvm.select" (%a,%v2,%b) : (_, _, _) -> (_) - "llvm.return" (%v3) : (_) -> () -}] - -def alive_Select_858_tgt (w : Nat) := -[mlir_icom ( w )| { -^bb0(%a : _, %b : _): - %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) - %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) - %v3 = "llvm.and" (%v2,%b) : (_, _) -> (_) - "llvm.return" (%v3) : (_) -> () -}] -theorem alive_Select_858 (w : Nat) : alive_Select_858_src w ⊑ alive_Select_858_tgt w := by - unfold alive_Select_858_src alive_Select_858_tgt - simp_alive_peephole - apply bitvec_Select_858 +-- def alive_Select_858_src (w : Nat) := +-- [mlir_icom ( w )| { +-- ^bb0(%a : _, %b : _): +-- %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) +-- %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) +-- %v3 = "llvm.select" (%a,%v2,%b) : (_, _, _) -> (_) +-- "llvm.return" (%v3) : (_) -> () +-- }] + +-- def alive_Select_858_tgt (w : Nat) := +-- [mlir_icom ( w )| { +-- ^bb0(%a : _, %b : _): +-- %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) +-- %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) +-- %v3 = "llvm.and" (%v2,%b) : (_, _) -> (_) +-- "llvm.return" (%v3) : (_) -> () +-- }] +-- theorem alive_Select_858 (w : Nat) : alive_Select_858_src w ⊑ alive_Select_858_tgt w := by +-- unfold alive_Select_858_src alive_Select_858_tgt +-- simp_alive_peephole +-- apply bitvec_Select_858 -- Name:Select:859' @@ -3649,27 +3661,27 @@ theorem alive_Select_858 (w : Nat) : alive_Select_858_src w ⊑ alive_Select %r = or %nota, %b -/ -def alive_Select_859'_src (w : Nat) := -[mlir_icom ( w )| { -^bb0(%a : _, %b : _): - %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) - %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) - %v3 = "llvm.select" (%a,%b,%v2) : (_, _, _) -> (_) - "llvm.return" (%v3) : (_) -> () -}] - -def alive_Select_859'_tgt (w : Nat) := -[mlir_icom ( w )| { -^bb0(%a : _, %b : _): - %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) - %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) - %v3 = "llvm.or" (%v2,%b) : (_, _) -> (_) - "llvm.return" (%v3) : (_) -> () -}] -theorem alive_Select_859' (w : Nat) : alive_Select_859'_src w ⊑ alive_Select_859'_tgt w := by - unfold alive_Select_859'_src alive_Select_859'_tgt - simp_alive_peephole - apply bitvec_Select_859' +-- def alive_Select_859'_src (w : Nat) := +-- [mlir_icom ( w )| { +-- ^bb0(%a : _, %b : _): +-- %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) +-- %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) +-- %v3 = "llvm.select" (%a,%b,%v2) : (_, _, _) -> (_) +-- "llvm.return" (%v3) : (_) -> () +-- }] + +-- def alive_Select_859'_tgt (w : Nat) := +-- [mlir_icom ( w )| { +-- ^bb0(%a : _, %b : _): +-- %v1 = "llvm.mlir.constant" () { value = -1 : _ } :() -> (_) +-- %v2 = "llvm.xor" (%a,%v1) : (_, _) -> (_) +-- %v3 = "llvm.or" (%v2,%b) : (_, _) -> (_) +-- "llvm.return" (%v3) : (_) -> () +-- }] +-- theorem alive_Select_859' (w : Nat) : alive_Select_859'_src w ⊑ alive_Select_859'_tgt w := by +-- unfold alive_Select_859'_src alive_Select_859'_tgt +-- simp_alive_peephole +-- apply bitvec_Select_859' -- Name:Select:1087 @@ -3683,27 +3695,27 @@ theorem alive_Select_859' (w : Nat) : alive_Select_859'_src w ⊑ alive_Sele %r = select i1 %val, %Y, %X -/ -def alive_Select_1087_src (w : Nat) := -[mlir_icom ( w )| { -^bb0(%Y : _, %X : _, %val : _): - %v1 = "llvm.mlir.constant" () { value = 1 : 1 } :() -> (i1) - %v2 = "llvm.xor" (%val,%v1) : (_, i1) -> (i1) - %v3 = "llvm.select" (%v2,%X,%Y) : (i1, _, _) -> (_) - "llvm.return" (%v3) : (_) -> () -}] - -def alive_Select_1087_tgt (w : Nat) := -[mlir_icom ( w )| { -^bb0(%Y : _, %X : _, %val : _): - %v1 = "llvm.mlir.constant" () { value = 1 : 1 } :() -> (i1) - %v2 = "llvm.xor" (%val,%v1) : (_, i1) -> (i1) - %v3 = "llvm.select" (%val,%Y,%X) : (_, _, _) -> (_) - "llvm.return" (%v3) : (_) -> () -}] -theorem alive_Select_1087 (w : Nat) : alive_Select_1087_src w ⊑ alive_Select_1087_tgt w := by - unfold alive_Select_1087_src alive_Select_1087_tgt - simp_alive_peephole - apply bitvec_Select_1087 +-- def alive_Select_1087_src (w : Nat) := +-- [mlir_icom ( w )| { +-- ^bb0(%Y : _, %X : _, %val : _): +-- %v1 = "llvm.mlir.constant" () { value = 1 : i1 } :() -> (i1) +-- %v2 = "llvm.xor" (%val,%v1) : (_, i1) -> (i1) +-- %v3 = "llvm.select" (%v2,%X,%Y) : (i1, _, _) -> (_) +-- "llvm.return" (%v3) : (_) -> () +-- }] + +-- def alive_Select_1087_tgt (w : Nat) := +-- [mlir_icom ( w )| { +-- ^bb0(%Y : _, %X : _, %val : _): +-- %v1 = "llvm.mlir.constant" () { value = 1 : i1 } :() -> (i1) +-- %v2 = "llvm.xor" (%val,%v1) : (_, i1) -> (i1) +-- %v3 = "llvm.select" (%val,%Y,%X) : (_, _, _) -> (_) +-- "llvm.return" (%v3) : (_) -> () +-- }] +-- theorem alive_Select_1087 (w : Nat) : alive_Select_1087_src w ⊑ alive_Select_1087_tgt w := by +-- unfold alive_Select_1087_src alive_Select_1087_tgt +-- simp_alive_peephole +-- apply bitvec_Select_1087 -- Name:Select:1100 @@ -3718,7 +3730,7 @@ theorem alive_Select_1087 (w : Nat) : alive_Select_1087_src w ⊑ alive_Sele def alive_Select_1100_src (w : Nat) := [mlir_icom ( w )| { ^bb0(%Y : _, %X : _): - %v1 = "llvm.mlir.constant" () { value = 1 : 1 } :() -> (i1) + %v1 = "llvm.mlir.constant" () { value = 1 : i1 } :() -> (i1) %v2 = "llvm.select" (%v1,%X,%Y) : (i1, _, _) -> (_) "llvm.return" (%v2) : (_) -> () }] @@ -3731,8 +3743,8 @@ def alive_Select_1100_tgt (w : Nat) := }] theorem alive_Select_1100 (w : Nat) : alive_Select_1100_src w ⊑ alive_Select_1100_tgt w := by unfold alive_Select_1100_src alive_Select_1100_tgt - simp_alive_peephole - apply bitvec_Select_1100 + simp_alive_peephole <;> sorry + -- apply bitvec_Select_1100 -- Name:Select:1105 @@ -3747,7 +3759,7 @@ theorem alive_Select_1100 (w : Nat) : alive_Select_1100_src w ⊑ alive_Sele def alive_Select_1105_src (w : Nat) := [mlir_icom ( w )| { ^bb0(%Y : _, %X : _): - %v1 = "llvm.mlir.constant" () { value = 0 : 1 } :() -> (i1) + %v1 = "llvm.mlir.constant" () { value = 0 : i1 } :() -> (i1) %v2 = "llvm.select" (%v1,%X,%Y) : (i1, _, _) -> (_) "llvm.return" (%v2) : (_) -> () }] @@ -3760,8 +3772,8 @@ def alive_Select_1105_tgt (w : Nat) := }] theorem alive_Select_1105 (w : Nat) : alive_Select_1105_src w ⊑ alive_Select_1105_tgt w := by unfold alive_Select_1105_src alive_Select_1105_tgt - simp_alive_peephole - apply bitvec_Select_1105 + simp_alive_peephole <;> sorry + -- apply bitvec_Select_1105 -- Name:InstCombineShift: 239 diff --git a/SSA/Projects/InstCombine/Tactic.lean b/SSA/Projects/InstCombine/Tactic.lean index 48808c371..50cba530b 100644 --- a/SSA/Projects/InstCombine/Tactic.lean +++ b/SSA/Projects/InstCombine/Tactic.lean @@ -30,10 +30,10 @@ macro "simp_alive_peephole" : tactic => dsimp only [Com.Refinement] intros Γv simp_peephole at Γv - /- note that we need the `HVector.toPair`, `HVector.toSingle` lemmas since it's used in `InstCombine.Op.denote` + /- note that we need the `HVector.toPair`, `HVector.toSingle`, `HVector.toTriple` lemmas since it's used in `InstCombine.Op.denote` We need `HVector.toTuple` since it's used in `MLIR.AST.mkOpExpr`. -/ try simp (config := {decide := false}) only [OpDenote.denote, - InstCombine.Op.denote, HVector.toPair, pairMapM, BitVec.Refinement, + InstCombine.Op.denote, HVector.toPair, HVector.toTriple, pairMapM, BitVec.Refinement, bind, Option.bind, pure, DerivedContext.ofContext, DerivedContext.snoc, Ctxt.snoc, MOp.instantiateCom, InstCombine.MTy.instantiate, ConcreteOrMVar.instantiate, Vector.get, HVector.toSingle, @@ -44,12 +44,12 @@ macro "simp_alive_peephole" : tactic => try intros v3 try intros v4 try intros v5 - try cases' v0 with x0 <;> simp - <;> try cases' v1 with x1 <;> simp - <;> try cases' v2 with x2 <;> simp - <;> try cases' v3 with x3 <;> simp - <;> try cases' v4 with x4 <;> simp - <;> try cases' v5 with x5 <;> simp + try cases' v0 with x0 <;> simp[Option.bind, bind, Monad.toBind] <;> dsimp[Option.bind, bind, Monad.toBind] + <;> try cases' v1 with x1 <;> simp[Option.bind, bind, Monad.toBind] <;> dsimp[Option.bind, bind, Monad.toBind] + <;> try cases' v2 with x2 <;> simp[Option.bind, bind, Monad.toBind] <;> dsimp[Option.bind, bind, Monad.toBind] + <;> try cases' v3 with x3 <;> simp[Option.bind, bind, Monad.toBind] <;> dsimp[Option.bind, bind, Monad.toBind] + <;> try cases' v4 with x4 <;> simp[Option.bind, bind, Monad.toBind] <;> dsimp[Option.bind, bind, Monad.toBind] + <;> try cases' v5 with x5 <;> simp[Option.bind, bind, Monad.toBind] <;> dsimp[Option.bind, bind, Monad.toBind] try revert v5 try revert v4 try revert v3 From 3a976028d9ee6d3c7029755830ccae3494f7cf4e Mon Sep 17 00:00:00 2001 From: Siddharth Bhat Date: Wed, 1 Nov 2023 16:11:13 +0000 Subject: [PATCH 09/12] fix: add proof of bitvec fact --- SSA/Projects/InstCombine/Tactic.lean | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/SSA/Projects/InstCombine/Tactic.lean b/SSA/Projects/InstCombine/Tactic.lean index 50cba530b..ccd2af4d3 100644 --- a/SSA/Projects/InstCombine/Tactic.lean +++ b/SSA/Projects/InstCombine/Tactic.lean @@ -10,11 +10,14 @@ theorem bitvec_minus_one : BitVec.ofInt w (Int.negSucc 0) = (-1 : BitVec w) := b simp[BitVec.ofInt, BitVec.ofNat,Neg.neg, BitVec.neg, BitVec.sub, BitVec.toFin, Fin.ofNat', HSub.hSub, Sub.sub, Fin.sub] simp - sorry - - - - + cases w + case zero => norm_num + case succ w' => + norm_num + have ONE : 1 % 2^ Nat.succ w' = 1 := by + apply Nat.mod_eq_of_lt + simp + rw[ONE] /-- - We first simplify `Com.refinement` to see the context `Γv`. From c8a2d7dfd7419c22173ee7250605df52193a92e3 Mon Sep 17 00:00:00 2001 From: Siddharth Bhat Date: Wed, 1 Nov 2023 16:15:25 +0000 Subject: [PATCH 10/12] fixup diff nits --- SSA/Core/Util/ConcreteOrMVar.lean | 4 ++-- SSA/Projects/MLIRSyntax/AST.lean | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/SSA/Core/Util/ConcreteOrMVar.lean b/SSA/Core/Util/ConcreteOrMVar.lean index ed263c7dd..a26d9ca6a 100644 --- a/SSA/Core/Util/ConcreteOrMVar.lean +++ b/SSA/Core/Util/ConcreteOrMVar.lean @@ -13,8 +13,8 @@ inductive ConcreteOrMVar (α : Type u) (φ : Nat) instance [ToString α] : ToString (ConcreteOrMVar α n) where toString - | .concrete a => s!"wconcrete({a})" - | .mvar i => s!"wmvar({i})" + | .concrete a => s!"concrete({a})" + | .mvar i => s!"mvar({i})" /-- A coercion from the concrete type `α` to the `ConcreteOrMVar` -/ instance : Coe α (ConcreteOrMVar α φ) := ⟨.concrete⟩ diff --git a/SSA/Projects/MLIRSyntax/AST.lean b/SSA/Projects/MLIRSyntax/AST.lean index 0e7df6d16..de4038ab8 100644 --- a/SSA/Projects/MLIRSyntax/AST.lean +++ b/SSA/Projects/MLIRSyntax/AST.lean @@ -333,7 +333,7 @@ def AttrDict.find_nat {φ} (attrs : AttrDict φ) (name : String) : Option Nat := | _ => .none def AttrDict.find_int {φ} (attrs : AttrDict φ) - (name : String) : Option (Int × MLIRType φ) := + (name : String): Option (Int × MLIRType φ) := match attrs.find name with | .some (AttrValue.int i ty) => .some (i, ty) | _ => .none From 7b42b46def6d829c0c3cdd9708b0145e2d118ed8 Mon Sep 17 00:00:00 2001 From: Siddharth Bhat Date: Wed, 1 Nov 2023 16:17:19 +0000 Subject: [PATCH 11/12] add new alive commit --- related-work/alive/alive | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/related-work/alive/alive b/related-work/alive/alive index d4568eccd..25da30a29 160000 --- a/related-work/alive/alive +++ b/related-work/alive/alive @@ -1 +1 @@ -Subproject commit d4568eccde2c06225e3fbb4036f21762380927c1 +Subproject commit 25da30a29723b41ae96bdab8bf386ce74a61c0ea From fd083a3e270c915a20a2f1e78eaeb54484c659d5 Mon Sep 17 00:00:00 2001 From: Siddharth Bhat Date: Wed, 1 Nov 2023 17:42:47 +0000 Subject: [PATCH 12/12] remove 'dsimp' as it was causing the proof state to explode --- SSA/Projects/InstCombine/Tactic.lean | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/SSA/Projects/InstCombine/Tactic.lean b/SSA/Projects/InstCombine/Tactic.lean index ccd2af4d3..eada66502 100644 --- a/SSA/Projects/InstCombine/Tactic.lean +++ b/SSA/Projects/InstCombine/Tactic.lean @@ -47,12 +47,13 @@ macro "simp_alive_peephole" : tactic => try intros v3 try intros v4 try intros v5 - try cases' v0 with x0 <;> simp[Option.bind, bind, Monad.toBind] <;> dsimp[Option.bind, bind, Monad.toBind] - <;> try cases' v1 with x1 <;> simp[Option.bind, bind, Monad.toBind] <;> dsimp[Option.bind, bind, Monad.toBind] - <;> try cases' v2 with x2 <;> simp[Option.bind, bind, Monad.toBind] <;> dsimp[Option.bind, bind, Monad.toBind] - <;> try cases' v3 with x3 <;> simp[Option.bind, bind, Monad.toBind] <;> dsimp[Option.bind, bind, Monad.toBind] - <;> try cases' v4 with x4 <;> simp[Option.bind, bind, Monad.toBind] <;> dsimp[Option.bind, bind, Monad.toBind] - <;> try cases' v5 with x5 <;> simp[Option.bind, bind, Monad.toBind] <;> dsimp[Option.bind, bind, Monad.toBind] + try cases' v0 with x0 <;> simp[Option.bind, bind, Monad.toBind] + <;> try cases' v1 with x1 <;> simp[Option.bind, bind, Monad.toBind] + <;> try cases' v2 with x2 <;> simp[Option.bind, bind, Monad.toBind] + <;> try cases' v3 with x3 <;> simp[Option.bind, bind, Monad.toBind] + <;> try cases' v4 with x4 <;> simp[Option.bind, bind, Monad.toBind] + <;> try cases' v5 with x5 <;> simp[Option.bind, bind, Monad.toBind] + <;> dsimp[Option.bind, bind, Monad.toBind] try revert v5 try revert v4 try revert v3