diff --git a/Cargo.lock b/Cargo.lock index d240e1346..499452d9f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1088,8 +1088,7 @@ dependencies = [ [[package]] name = "hugr" version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d8b180fc27111bc631352b8516a281703430d96b4e0c4bedecb00585bb7bbb2" +source = "git+https://github.com/quantinuum/hugr?rev=5415abebf35be4af4e5bac5c7fe54381aea55a3e#5415abebf35be4af4e5bac5c7fe54381aea55a3e" dependencies = [ "hugr-core", "hugr-llvm", @@ -1100,8 +1099,7 @@ dependencies = [ [[package]] name = "hugr-cli" version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21a63e1e7d6f798e9bd032fd616854b4294d680056088a386d8a9a6c00b4291c" +source = "git+https://github.com/quantinuum/hugr?rev=5415abebf35be4af4e5bac5c7fe54381aea55a3e#5415abebf35be4af4e5bac5c7fe54381aea55a3e" dependencies = [ "anyhow", "clap", @@ -1109,7 +1107,7 @@ dependencies = [ "clio", "derive_more 2.1.0", "hugr", - "schemars 1.0.5", + "schemars 1.1.0", "serde", "serde_json", "tabled", @@ -1121,8 +1119,7 @@ dependencies = [ [[package]] name = "hugr-core" version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cde86f402bdea148e74c72a951354839dd1fb1f703fe620b4ef4d471a7d5978" +source = "git+https://github.com/quantinuum/hugr?rev=5415abebf35be4af4e5bac5c7fe54381aea55a3e#5415abebf35be4af4e5bac5c7fe54381aea55a3e" dependencies = [ "base64", "cgmath", @@ -1141,7 +1138,7 @@ dependencies = [ "regex", "relrc", "rustc-hash 2.1.1", - "schemars 1.0.5", + "schemars 1.1.0", "semver", "serde", "serde_json", @@ -1159,8 +1156,7 @@ dependencies = [ [[package]] name = "hugr-llvm" version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c55104ec359dcf7c608a903dcb69be0297fcdda812c37bce18ee13b0ca3a0930" +source = "git+https://github.com/quantinuum/hugr?rev=5415abebf35be4af4e5bac5c7fe54381aea55a3e#5415abebf35be4af4e5bac5c7fe54381aea55a3e" dependencies = [ "anyhow", "cc", @@ -1179,8 +1175,7 @@ dependencies = [ [[package]] name = "hugr-model" version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2db0fbf9bf9e6f5828b905403c3c1e3b3b4e27520e92930a16915abbef60909b" +source = "git+https://github.com/quantinuum/hugr?rev=5415abebf35be4af4e5bac5c7fe54381aea55a3e#5415abebf35be4af4e5bac5c7fe54381aea55a3e" dependencies = [ "base64", "bumpalo", @@ -1201,8 +1196,7 @@ dependencies = [ [[package]] name = "hugr-passes" version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e170464e6c94176cd39099f52bac95552bf360b971959cd8a4a27d76e645ab9" +source = "git+https://github.com/quantinuum/hugr?rev=5415abebf35be4af4e5bac5c7fe54381aea55a3e#5415abebf35be4af4e5bac5c7fe54381aea55a3e" dependencies = [ "ascent", "derive_more 2.1.0", @@ -1285,23 +1279,22 @@ dependencies = [ [[package]] name = "inkwell" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e67349bd7578d4afebbe15eaa642a80b884e8623db74b1716611b131feb1deef" +checksum = "39457e8611219cf690f862a470575f5c06862910d03ea3c3b187ad7abc44b4e2" dependencies = [ - "either", "inkwell_internals", "libc", "llvm-sys", "once_cell", - "thiserror 1.0.69", + "thiserror 2.0.17", ] [[package]] name = "inkwell_internals" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f365c8de536236cfdebd0ba2130de22acefed18b1fb99c32783b3840aec5fb46" +checksum = "ad9a7dd586b00f2b20e0b9ae3c6faa351fbfd56d15d63bbce35b13bece682eda" dependencies = [ "proc-macro2", "quote", @@ -1629,9 +1622,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pastey" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35fb2e5f958ec131621fdd531e9fc186ed768cbe395337403ae56c17a74c68ec" +checksum = "57d6c094ee800037dff99e02cab0eaf3142826586742a270ab3d7a62656bd27a" [[package]] name = "peak_alloc" @@ -1883,9 +1876,9 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.26.0" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba0117f4212101ee6544044dae45abe1083d30ce7b29c4b5cbdfa2354e07383" +checksum = "ab53c047fcd1a1d2a8820fe84f05d6be69e9526be40cb03b73f86b6b03e6d87d" dependencies = [ "anyhow", "indoc", @@ -1893,7 +1886,7 @@ dependencies = [ "memoffset", "once_cell", "portable-atomic", - "pyo3-build-config 0.26.0", + "pyo3-build-config", "pyo3-ffi", "pyo3-macros", "unindent", @@ -1901,37 +1894,28 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fc6ddaf24947d12a9aa31ac65431fb1b851b8f4365426e182901eabfb87df5f" -dependencies = [ - "target-lexicon", -] - -[[package]] -name = "pyo3-build-config" -version = "0.27.1" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f77d387774f6f6eec64a004eac0ed525aab7fa1966d94b42f743797b3e395afb" +checksum = "b455933107de8642b4487ed26d912c2d899dec6114884214a0b3bb3be9261ea6" dependencies = [ "target-lexicon", ] [[package]] name = "pyo3-ffi" -version = "0.26.0" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "025474d3928738efb38ac36d4744a74a400c901c7596199e20e45d98eb194105" +checksum = "1c85c9cbfaddf651b1221594209aed57e9e5cff63c4d11d1feead529b872a089" dependencies = [ "libc", - "pyo3-build-config 0.26.0", + "pyo3-build-config", ] [[package]] name = "pyo3-macros" -version = "0.26.0" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e64eb489f22fe1c95911b77c44cc41e7c19f3082fc81cce90f657cdc42ffded" +checksum = "0a5b10c9bf9888125d917fb4d2ca2d25c8df94c7ab5a52e13313a07e050a3b02" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -1941,22 +1925,22 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.26.0" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "100246c0ecf400b475341b8455a9213344569af29a3c841d29270e53102e0fcf" +checksum = "03b51720d314836e53327f5871d4c0cfb4fb37cc2c4a11cc71907a86342c40f9" dependencies = [ "heck", "proc-macro2", - "pyo3-build-config 0.26.0", + "pyo3-build-config", "quote", "syn 2.0.108", ] [[package]] name = "pythonize" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11e06e4cff9be2bbf2bddf28a486ae619172ea57e79787f856572878c62dcfe2" +checksum = "a3a8f29db331e28c332c63496cfcbb822aca3d7320bc08b655d7fd0c29c50ede" dependencies = [ "pyo3", "serde", @@ -2222,9 +2206,9 @@ dependencies = [ [[package]] name = "schemars" -version = "1.0.5" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1317c3bf3e7df961da95b0a56a172a02abead31276215a0497241a7624b487ce" +checksum = "9558e172d4e8533736ba97870c4b2cd63f84b382a3d6eb063da41b91cce17289" dependencies = [ "dyn-clone", "ref-cast", @@ -2235,9 +2219,9 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "1.0.5" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f760a6150d45dd66ec044983c124595ae76912e77ed0b44124cb3e415cce5d9" +checksum = "301858a4023d78debd2353c7426dc486001bddc91ae31a76fb1f55132f7e2633" dependencies = [ "proc-macro2", "quote", @@ -2260,7 +2244,7 @@ dependencies = [ "insta", "itertools 0.14.0", "pyo3", - "pyo3-build-config 0.27.1", + "pyo3-build-config", "rstest", "serde", "serde_json", @@ -2356,7 +2340,7 @@ dependencies = [ "indexmap 1.9.3", "indexmap 2.12.1", "schemars 0.9.0", - "schemars 1.0.5", + "schemars 1.1.0", "serde_core", "serde_json", "serde_with_macros", @@ -2709,9 +2693,9 @@ dependencies = [ [[package]] name = "tket-json-rs" -version = "0.7.7" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c424855b86bde6c2d1651241abf829f1bfcd8e5428356576ac11bd825357bc" +checksum = "aea5374e5ef784cd4825cfcd7cfaf4c8a6a39a2da6129b12181aa0c9234f9678" dependencies = [ "derive_more 2.1.0", "pyo3", @@ -3002,13 +2986,13 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.18.1" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f87b8aa10b915a06587d0dec516c282ff295b475d94abf425d62b57710070a2" +checksum = "e2e054861b4bd027cd373e18e8d8d8e6548085000e41290d95ce0c373a654b4a" dependencies = [ "getrandom", "js-sys", - "serde", + "serde_core", "wasm-bindgen", ] diff --git a/Cargo.toml b/Cargo.toml index 0510d7b3d..68bcecc54 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,11 +40,11 @@ large_enum_variant = "allow" [patch.crates-io] # Uncomment to use unreleased versions of hugr -# hugr = { git = "https://github.com/quantinuum/hugr", "branch" = "ts/ba-copy-discard" } -# hugr-core = { git = "https://github.com/quantinuum/hugr", "branch" = "ts/ba-copy-discard" } -# hugr-cli = { git = "https://github.com/quantinuum/hugr", "branch" = "ts/ba-copy-discard" } -# hugr-passes = { git = "https://github.com/quantinuum/hugr", "branch" = "ts/ba-copy-discard" } -# hugr-llvm = { git = "https://github.com/quantinuum/hugr", "branch" = "ts/ba-copy-discard" } +hugr = { git = "https://github.com/quantinuum/hugr", "rev" = "5415abebf35be4af4e5bac5c7fe54381aea55a3e" } +hugr-core = { git = "https://github.com/quantinuum/hugr", "rev" = "5415abebf35be4af4e5bac5c7fe54381aea55a3e" } +hugr-cli = { git = "https://github.com/quantinuum/hugr", "rev" = "5415abebf35be4af4e5bac5c7fe54381aea55a3e" } +hugr-passes = { git = "https://github.com/quantinuum/hugr", "rev" = "5415abebf35be4af4e5bac5c7fe54381aea55a3e" } +hugr-llvm = { git = "https://github.com/quantinuum/hugr", "rev" = "5415abebf35be4af4e5bac5c7fe54381aea55a3e" } # portgraph = { git = "https://github.com/quantinuum/portgraph", rev = "68b96ac737e0c285d8c543b2d74a7aa80a18202c" } [workspace.dependencies] @@ -54,15 +54,17 @@ hugr = "0.24.3" hugr-core = "0.24.3" hugr-cli = "0.24.3" portgraph = "0.15.3" -pyo3 = ">= 0.23.4, < 0.27" -pyo3-build-config = ">= 0.23.4, < 0.28" +# There can only be one `pyo3` dependency in the whole workspace, so we use a +# loose version constraint to prevent breaking changes in dependent crates where possible. +pyo3 = ">= 0.27.2, < 0.28" +pyo3-build-config = ">= 0.27.2, < 0.28" bindgen = "0.72" cbindgen = "0.29" cc = "1.2.49" conan2 = "0.1.8" itertools = "0.14.0" -tket-json-rs = "0.7.7" +tket-json-rs = "0.8.0" portmatching = "0.3.3" bytemuck = "1.24.0" cgmath = "0.18.0" diff --git a/justfile b/justfile index 838701907..be1481a5b 100644 --- a/justfile +++ b/justfile @@ -16,7 +16,7 @@ _check_default_conan_profile: # Prepare the environment for development, installing all the dependencies and # setting up the pre-commit hooks. -setup: _check_default_conan_profile _check_nextest_installed +setup: && _check_default_conan_profile _check_nextest_installed uv tool install conan uv sync [[ -n "${TKET_JUST_INHIBIT_GIT_HOOKS:-}" ]] || uv run pre-commit install -t pre-commit diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin index 2344ed455..e980f229f 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin @@ -38,8 +38,8 @@ entry: br label %cond_20_case_1.i cond_20_case_1.i: ; preds = %cond_exit_20.i, %entry - %"15_0.sroa.0.0295.i" = phi i64 [ 0, %entry ], [ %5, %cond_exit_20.i ] - %5 = add nuw nsw i64 %"15_0.sroa.0.0295.i", 1 + %"15_0.sroa.0.0294.i" = phi i64 [ 0, %entry ], [ %5, %cond_exit_20.i ] + %5 = add nuw nsw i64 %"15_0.sroa.0.0294.i", 1 %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.i.i = icmp eq i64 %qalloc.i.i, -1 br i1 %not_max.not.i.i, label %id_bb.i.i, label %reset_bb.i.i @@ -59,10 +59,10 @@ cond_217_case_0.i.i: ; preds = %id_bb.i.i unreachable __barray_check_bounds.exit.i: ; preds = %id_bb.i.i - %8 = lshr i64 %"15_0.sroa.0.0295.i", 6 + %8 = lshr i64 %"15_0.sroa.0.0294.i", 6 %9 = getelementptr inbounds i64, i64* %4, i64 %8 %10 = load i64, i64* %9, align 4 - %11 = shl nuw nsw i64 1, %"15_0.sroa.0.0295.i" + %11 = shl nuw nsw i64 1, %"15_0.sroa.0.0294.i" %12 = and i64 %10, %11 %.not.i.i = icmp eq i64 %12, 0 br i1 %.not.i.i, label %panic.i.i, label %cond_exit_20.i @@ -75,7 +75,7 @@ cond_exit_20.i: ; preds = %__barray_check_boun %.fca.1.extract.i.i = extractvalue { i1, i64 } %7, 1 %13 = xor i64 %10, %11 store i64 %13, i64* %9, align 4 - %14 = getelementptr inbounds i64, i64* %2, i64 %"15_0.sroa.0.0295.i" + %14 = getelementptr inbounds i64, i64* %2, i64 %"15_0.sroa.0.0294.i" store i64 %.fca.1.extract.i.i, i64* %14, align 4 %exitcond.not.i = icmp eq i64 %5, 10 br i1 %exitcond.not.i, label %loop_out.i, label %cond_20_case_1.i @@ -83,10 +83,10 @@ cond_exit_20.i: ; preds = %__barray_check_boun loop_out.i: ; preds = %cond_exit_20.i %15 = load i64, i64* %4, align 4 %16 = and i64 %15, 1 - %.not.i259.i = icmp eq i64 %16, 0 - br i1 %.not.i259.i, label %__barray_mask_borrow.exit.i, label %panic.i260.i + %.not.i258.i = icmp eq i64 %16, 0 + br i1 %.not.i258.i, label %__barray_mask_borrow.exit.i, label %panic.i259.i -panic.i260.i: ; preds = %loop_out.i +panic.i259.i: ; preds = %loop_out.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable @@ -97,27 +97,27 @@ __barray_mask_borrow.exit.i: ; preds = %loop_out.i tail call void @___rxy(i64 %18, double 0x400921FB54442D18, double 0.000000e+00) %19 = load i64, i64* %4, align 4 %20 = and i64 %19, 1 - %.not.i261.i = icmp eq i64 %20, 0 - br i1 %.not.i261.i, label %panic.i262.i, label %__barray_mask_return.exit263.i + %.not.i260.i = icmp eq i64 %20, 0 + br i1 %.not.i260.i, label %panic.i261.i, label %__barray_mask_return.exit262.i -panic.i262.i: ; preds = %__barray_mask_borrow.exit.i +panic.i261.i: ; preds = %__barray_mask_borrow.exit.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit263.i: ; preds = %__barray_mask_borrow.exit.i +__barray_mask_return.exit262.i: ; preds = %__barray_mask_borrow.exit.i %21 = xor i64 %19, 1 store i64 %21, i64* %4, align 4 store i64 %18, i64* %2, align 4 %22 = load i64, i64* %4, align 4 %23 = and i64 %22, 4 - %.not.i264.i = icmp eq i64 %23, 0 - br i1 %.not.i264.i, label %__barray_mask_borrow.exit266.i, label %panic.i265.i + %.not.i263.i = icmp eq i64 %23, 0 + br i1 %.not.i263.i, label %__barray_mask_borrow.exit265.i, label %panic.i264.i -panic.i265.i: ; preds = %__barray_mask_return.exit263.i +panic.i264.i: ; preds = %__barray_mask_return.exit262.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable -__barray_mask_borrow.exit266.i: ; preds = %__barray_mask_return.exit263.i +__barray_mask_borrow.exit265.i: ; preds = %__barray_mask_return.exit262.i %24 = xor i64 %22, 4 store i64 %24, i64* %4, align 4 %25 = getelementptr inbounds i8, i8* %1, i64 16 @@ -126,27 +126,27 @@ __barray_mask_borrow.exit266.i: ; preds = %__barray_mask_retur tail call void @___rxy(i64 %27, double 0x400921FB54442D18, double 0.000000e+00) %28 = load i64, i64* %4, align 4 %29 = and i64 %28, 4 - %.not.i267.i = icmp eq i64 %29, 0 - br i1 %.not.i267.i, label %panic.i268.i, label %__barray_mask_return.exit269.i + %.not.i266.i = icmp eq i64 %29, 0 + br i1 %.not.i266.i, label %panic.i267.i, label %__barray_mask_return.exit268.i -panic.i268.i: ; preds = %__barray_mask_borrow.exit266.i +panic.i267.i: ; preds = %__barray_mask_borrow.exit265.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit269.i: ; preds = %__barray_mask_borrow.exit266.i +__barray_mask_return.exit268.i: ; preds = %__barray_mask_borrow.exit265.i %30 = xor i64 %28, 4 store i64 %30, i64* %4, align 4 store i64 %27, i64* %26, align 4 %31 = load i64, i64* %4, align 4 %32 = and i64 %31, 8 - %.not.i270.i = icmp eq i64 %32, 0 - br i1 %.not.i270.i, label %__barray_mask_borrow.exit272.i, label %panic.i271.i + %.not.i269.i = icmp eq i64 %32, 0 + br i1 %.not.i269.i, label %__barray_mask_borrow.exit271.i, label %panic.i270.i -panic.i271.i: ; preds = %__barray_mask_return.exit269.i +panic.i270.i: ; preds = %__barray_mask_return.exit268.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable -__barray_mask_borrow.exit272.i: ; preds = %__barray_mask_return.exit269.i +__barray_mask_borrow.exit271.i: ; preds = %__barray_mask_return.exit268.i %33 = xor i64 %31, 8 store i64 %33, i64* %4, align 4 %34 = getelementptr inbounds i8, i8* %1, i64 24 @@ -155,27 +155,27 @@ __barray_mask_borrow.exit272.i: ; preds = %__barray_mask_retur tail call void @___rxy(i64 %36, double 0x400921FB54442D18, double 0.000000e+00) %37 = load i64, i64* %4, align 4 %38 = and i64 %37, 8 - %.not.i273.i = icmp eq i64 %38, 0 - br i1 %.not.i273.i, label %panic.i274.i, label %__barray_mask_return.exit275.i + %.not.i272.i = icmp eq i64 %38, 0 + br i1 %.not.i272.i, label %panic.i273.i, label %__barray_mask_return.exit274.i -panic.i274.i: ; preds = %__barray_mask_borrow.exit272.i +panic.i273.i: ; preds = %__barray_mask_borrow.exit271.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit275.i: ; preds = %__barray_mask_borrow.exit272.i +__barray_mask_return.exit274.i: ; preds = %__barray_mask_borrow.exit271.i %39 = xor i64 %37, 8 store i64 %39, i64* %4, align 4 store i64 %36, i64* %35, align 4 %40 = load i64, i64* %4, align 4 %41 = and i64 %40, 512 - %.not.i276.i = icmp eq i64 %41, 0 - br i1 %.not.i276.i, label %__barray_mask_borrow.exit278.i, label %panic.i277.i + %.not.i275.i = icmp eq i64 %41, 0 + br i1 %.not.i275.i, label %__barray_mask_borrow.exit277.i, label %panic.i276.i -panic.i277.i: ; preds = %__barray_mask_return.exit275.i +panic.i276.i: ; preds = %__barray_mask_return.exit274.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable -__barray_mask_borrow.exit278.i: ; preds = %__barray_mask_return.exit275.i +__barray_mask_borrow.exit277.i: ; preds = %__barray_mask_return.exit274.i %42 = xor i64 %40, 512 store i64 %42, i64* %4, align 4 %43 = getelementptr inbounds i8, i8* %1, i64 72 @@ -184,14 +184,14 @@ __barray_mask_borrow.exit278.i: ; preds = %__barray_mask_retur tail call void @___rxy(i64 %45, double 0x400921FB54442D18, double 0.000000e+00) %46 = load i64, i64* %4, align 4 %47 = and i64 %46, 512 - %.not.i279.i = icmp eq i64 %47, 0 - br i1 %.not.i279.i, label %panic.i280.i, label %__barray_mask_return.exit281.i + %.not.i278.i = icmp eq i64 %47, 0 + br i1 %.not.i278.i, label %panic.i279.i, label %__barray_mask_return.exit280.i -panic.i280.i: ; preds = %__barray_mask_borrow.exit278.i +panic.i279.i: ; preds = %__barray_mask_borrow.exit277.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit281.i: ; preds = %__barray_mask_borrow.exit278.i +__barray_mask_return.exit280.i: ; preds = %__barray_mask_borrow.exit277.i %48 = xor i64 %46, 512 store i64 %48, i64* %4, align 4 store i64 %45, i64* %44, align 4 @@ -212,19 +212,19 @@ mask_block_ok.i.i.i.i: ; preds = %cond_exit_353.i.i "__hugr__.$measure_array$$n(10).277.exit.i": ; preds = %mask_block_ok.i.i.i.i tail call void @heap_free(i8* nonnull %1) tail call void @heap_free(i8* nonnull %3) - br label %__barray_check_bounds.exit284.i + br label %__barray_check_bounds.exit283.i mask_block_err.i.i.i.i: ; preds = %mask_block_ok.i.i.i.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @"e_Array cont.EFA5AC45.0", i64 0, i64 0)) unreachable -56: ; preds = %cond_exit_353.i.i, %__barray_mask_return.exit281.i - %"303_0.sroa.15.0.i297.i" = phi i64 [ 0, %__barray_mask_return.exit281.i ], [ %57, %cond_exit_353.i.i ] - %57 = add nuw nsw i64 %"303_0.sroa.15.0.i297.i", 1 - %58 = lshr i64 %"303_0.sroa.15.0.i297.i", 6 +56: ; preds = %cond_exit_353.i.i, %__barray_mask_return.exit280.i + %"303_0.sroa.15.0.i296.i" = phi i64 [ 0, %__barray_mask_return.exit280.i ], [ %57, %cond_exit_353.i.i ] + %57 = add nuw nsw i64 %"303_0.sroa.15.0.i296.i", 1 + %58 = lshr i64 %"303_0.sroa.15.0.i296.i", 6 %59 = getelementptr inbounds i64, i64* %4, i64 %58 %60 = load i64, i64* %59, align 4 - %61 = shl nuw nsw i64 1, %"303_0.sroa.15.0.i297.i" + %61 = shl nuw nsw i64 1, %"303_0.sroa.15.0.i296.i" %62 = and i64 %60, %61 %.not.i99.i.i.i = icmp eq i64 %62, 0 br i1 %.not.i99.i.i.i, label %__barray_check_bounds.exit.i.i, label %panic.i.i.i.i @@ -236,7 +236,7 @@ panic.i.i.i.i: ; preds = %56 __barray_check_bounds.exit.i.i: ; preds = %56 %63 = xor i64 %60, %61 store i64 %63, i64* %59, align 4 - %64 = getelementptr inbounds i64, i64* %2, i64 %"303_0.sroa.15.0.i297.i" + %64 = getelementptr inbounds i64, i64* %2, i64 %"303_0.sroa.15.0.i296.i" %65 = load i64, i64* %64, align 4 %lazy_measure.i.i = tail call i64 @___lazy_measure(i64 %65) tail call void @___qfree(i64 %65) @@ -254,51 +254,51 @@ cond_exit_353.i.i: ; preds = %__barray_check_boun %"367_054.fca.1.insert.i.i" = insertvalue { i1, i64, i1 } { i1 true, i64 poison, i1 poison }, i64 %lazy_measure.i.i, 1 %69 = xor i64 %67, %61 store i64 %69, i64* %66, align 4 - %70 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %50, i64 %"303_0.sroa.15.0.i297.i" + %70 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %50, i64 %"303_0.sroa.15.0.i296.i" store { i1, i64, i1 } %"367_054.fca.1.insert.i.i", { i1, i64, i1 }* %70, align 4 - %exitcond298.not.i = icmp eq i64 %57, 10 - br i1 %exitcond298.not.i, label %mask_block_ok.i.i.i.i, label %56 + %exitcond297.not.i = icmp eq i64 %57, 10 + br i1 %exitcond297.not.i, label %mask_block_ok.i.i.i.i, label %56 -cond_160_case_0.i: ; preds = %cond_exit_160.i +cond_187_case_0.i: ; preds = %cond_exit_187.i %71 = load i64, i64* %52, align 4 %72 = or i64 %71, -1024 store i64 %72, i64* %52, align 4 %73 = icmp eq i64 %72, -1 br i1 %73, label %__hugr__.main.1.exit, label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_160_case_0.i +mask_block_err.i.i: ; preds = %cond_187_case_0.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @"e_Array cont.EFA5AC45.0", i64 0, i64 0)) unreachable -__barray_check_bounds.exit284.i: ; preds = %"__hugr__.$measure_array$$n(10).277.exit.i", %cond_exit_160.i - %"162_0.0.i1" = phi i64 [ 0, %"__hugr__.$measure_array$$n(10).277.exit.i" ], [ %82, %cond_exit_160.i ] - %74 = lshr i64 %"162_0.0.i1", 6 +__barray_check_bounds.exit283.i: ; preds = %"__hugr__.$measure_array$$n(10).277.exit.i", %cond_exit_187.i + %"164_0.0.i1" = phi i64 [ 0, %"__hugr__.$measure_array$$n(10).277.exit.i" ], [ %82, %cond_exit_187.i ] + %74 = lshr i64 %"164_0.0.i1", 6 %75 = getelementptr inbounds i64, i64* %52, i64 %74 %76 = load i64, i64* %75, align 4 - %77 = shl nuw nsw i64 1, %"162_0.0.i1" + %77 = shl nuw nsw i64 1, %"164_0.0.i1" %78 = and i64 %76, %77 %.not.i = icmp eq i64 %78, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit289.i, label %cond_exit_160.i + br i1 %.not.i, label %__barray_mask_borrow.exit288.i, label %cond_exit_187.i -__barray_mask_borrow.exit289.i: ; preds = %__barray_check_bounds.exit284.i +__barray_mask_borrow.exit288.i: ; preds = %__barray_check_bounds.exit283.i %79 = xor i64 %76, %77 store i64 %79, i64* %75, align 4 - %80 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %50, i64 %"162_0.0.i1" + %80 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %50, i64 %"164_0.0.i1" %81 = load { i1, i64, i1 }, { i1, i64, i1 }* %80, align 4 - %.fca.0.extract180.i = extractvalue { i1, i64, i1 } %81, 0 - br i1 %.fca.0.extract180.i, label %cond_85_case_1.i, label %cond_exit_160.i + %.fca.0.extract179.i = extractvalue { i1, i64, i1 } %81, 0 + br i1 %.fca.0.extract179.i, label %cond_87_case_1.i, label %cond_exit_187.i -cond_exit_160.i: ; preds = %cond_85_case_1.i, %__barray_mask_borrow.exit289.i, %__barray_check_bounds.exit284.i - %82 = add nuw nsw i64 %"162_0.0.i1", 1 +cond_exit_187.i: ; preds = %cond_87_case_1.i, %__barray_mask_borrow.exit288.i, %__barray_check_bounds.exit283.i + %82 = add nuw nsw i64 %"164_0.0.i1", 1 %exitcond.not = icmp eq i64 %82, 10 - br i1 %exitcond.not, label %cond_160_case_0.i, label %__barray_check_bounds.exit284.i + br i1 %exitcond.not, label %cond_187_case_0.i, label %__barray_check_bounds.exit283.i -cond_85_case_1.i: ; preds = %__barray_mask_borrow.exit289.i +cond_87_case_1.i: ; preds = %__barray_mask_borrow.exit288.i %.fca.1.extract.i = extractvalue { i1, i64, i1 } %81, 1 tail call void @___dec_future_refcount(i64 %.fca.1.extract.i) - br label %cond_exit_160.i + br label %cond_exit_187.i -__hugr__.main.1.exit: ; preds = %cond_160_case_0.i +__hugr__.main.1.exit: ; preds = %cond_187_case_0.i tail call void @heap_free(i8* %49) tail call void @heap_free(i8* nonnull %51) %83 = tail call i64 @teardown() diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/aarch64-apple-darwin-print_array/print_array_aarch64-apple-darwin b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/aarch64-apple-darwin-print_array/print_array_aarch64-apple-darwin index 249b6f6ad..d13b5e031 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/aarch64-apple-darwin-print_array/print_array_aarch64-apple-darwin +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/aarch64-apple-darwin-print_array/print_array_aarch64-apple-darwin @@ -34,8 +34,8 @@ alloca_block: br label %cond_20_case_1 cond_20_case_1: ; preds = %alloca_block, %cond_exit_20 - %"15_0.sroa.0.0961" = phi i64 [ 0, %alloca_block ], [ %12, %cond_exit_20 ] - %12 = add nuw nsw i64 %"15_0.sroa.0.0961", 1 + %"15_0.sroa.0.0955" = phi i64 [ 0, %alloca_block ], [ %12, %cond_exit_20 ] + %12 = add nuw nsw i64 %"15_0.sroa.0.0955", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.i = icmp eq i64 %qalloc.i, -1 br i1 %not_max.not.i, label %id_bb.i, label %reset_bb.i @@ -55,10 +55,10 @@ cond_303_case_0.i: ; preds = %id_bb.i unreachable __barray_check_bounds.exit: ; preds = %id_bb.i - %15 = lshr i64 %"15_0.sroa.0.0961", 6 + %15 = lshr i64 %"15_0.sroa.0.0955", 6 %16 = getelementptr inbounds i64, i64* %11, i64 %15 %17 = load i64, i64* %16, align 4 - %18 = shl nuw nsw i64 1, %"15_0.sroa.0.0961" + %18 = shl nuw nsw i64 1, %"15_0.sroa.0.0955" %19 = and i64 %17, %18 %.not.i = icmp eq i64 %19, 0 br i1 %.not.i, label %panic.i, label %cond_exit_20 @@ -71,7 +71,7 @@ cond_exit_20: ; preds = %__barray_check_boun %.fca.1.extract.i = extractvalue { i1, i64 } %14, 1 %20 = xor i64 %17, %18 store i64 %20, i64* %16, align 4 - %21 = getelementptr inbounds i64, i64* %9, i64 %"15_0.sroa.0.0961" + %21 = getelementptr inbounds i64, i64* %9, i64 %"15_0.sroa.0.0955" store i64 %.fca.1.extract.i, i64* %21, align 4 %exitcond.not = icmp eq i64 %12, 10 br i1 %exitcond.not, label %loop_out, label %cond_20_case_1 @@ -79,10 +79,10 @@ cond_exit_20: ; preds = %__barray_check_boun loop_out: ; preds = %cond_exit_20 %22 = load i64, i64* %11, align 4 %23 = and i64 %22, 1 - %.not.i852 = icmp eq i64 %23, 0 - br i1 %.not.i852, label %__barray_mask_borrow.exit, label %panic.i853 + %.not.i846 = icmp eq i64 %23, 0 + br i1 %.not.i846, label %__barray_mask_borrow.exit, label %panic.i847 -panic.i853: ; preds = %loop_out +panic.i847: ; preds = %loop_out tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable @@ -93,27 +93,27 @@ __barray_mask_borrow.exit: ; preds = %loop_out tail call void @___rxy(i64 %25, double 0x400921FB54442D18, double 0.000000e+00) %26 = load i64, i64* %11, align 4 %27 = and i64 %26, 1 - %.not.i854 = icmp eq i64 %27, 0 - br i1 %.not.i854, label %panic.i855, label %__barray_mask_return.exit856 + %.not.i848 = icmp eq i64 %27, 0 + br i1 %.not.i848, label %panic.i849, label %__barray_mask_return.exit850 -panic.i855: ; preds = %__barray_mask_borrow.exit +panic.i849: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit856: ; preds = %__barray_mask_borrow.exit +__barray_mask_return.exit850: ; preds = %__barray_mask_borrow.exit %28 = xor i64 %26, 1 store i64 %28, i64* %11, align 4 store i64 %25, i64* %9, align 4 %29 = load i64, i64* %11, align 4 %30 = and i64 %29, 4 - %.not.i857 = icmp eq i64 %30, 0 - br i1 %.not.i857, label %__barray_mask_borrow.exit859, label %panic.i858 + %.not.i851 = icmp eq i64 %30, 0 + br i1 %.not.i851, label %__barray_mask_borrow.exit853, label %panic.i852 -panic.i858: ; preds = %__barray_mask_return.exit856 +panic.i852: ; preds = %__barray_mask_return.exit850 tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable -__barray_mask_borrow.exit859: ; preds = %__barray_mask_return.exit856 +__barray_mask_borrow.exit853: ; preds = %__barray_mask_return.exit850 %31 = xor i64 %29, 4 store i64 %31, i64* %11, align 4 %32 = getelementptr inbounds i8, i8* %8, i64 16 @@ -122,27 +122,27 @@ __barray_mask_borrow.exit859: ; preds = %__barray_mask_retur tail call void @___rxy(i64 %34, double 0x400921FB54442D18, double 0.000000e+00) %35 = load i64, i64* %11, align 4 %36 = and i64 %35, 4 - %.not.i860 = icmp eq i64 %36, 0 - br i1 %.not.i860, label %panic.i861, label %__barray_mask_return.exit862 + %.not.i854 = icmp eq i64 %36, 0 + br i1 %.not.i854, label %panic.i855, label %__barray_mask_return.exit856 -panic.i861: ; preds = %__barray_mask_borrow.exit859 +panic.i855: ; preds = %__barray_mask_borrow.exit853 tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit862: ; preds = %__barray_mask_borrow.exit859 +__barray_mask_return.exit856: ; preds = %__barray_mask_borrow.exit853 %37 = xor i64 %35, 4 store i64 %37, i64* %11, align 4 store i64 %34, i64* %33, align 4 %38 = load i64, i64* %11, align 4 %39 = and i64 %38, 8 - %.not.i863 = icmp eq i64 %39, 0 - br i1 %.not.i863, label %__barray_mask_borrow.exit865, label %panic.i864 + %.not.i857 = icmp eq i64 %39, 0 + br i1 %.not.i857, label %__barray_mask_borrow.exit859, label %panic.i858 -panic.i864: ; preds = %__barray_mask_return.exit862 +panic.i858: ; preds = %__barray_mask_return.exit856 tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable -__barray_mask_borrow.exit865: ; preds = %__barray_mask_return.exit862 +__barray_mask_borrow.exit859: ; preds = %__barray_mask_return.exit856 %40 = xor i64 %38, 8 store i64 %40, i64* %11, align 4 %41 = getelementptr inbounds i8, i8* %8, i64 24 @@ -151,27 +151,27 @@ __barray_mask_borrow.exit865: ; preds = %__barray_mask_retur tail call void @___rxy(i64 %43, double 0x400921FB54442D18, double 0.000000e+00) %44 = load i64, i64* %11, align 4 %45 = and i64 %44, 8 - %.not.i866 = icmp eq i64 %45, 0 - br i1 %.not.i866, label %panic.i867, label %__barray_mask_return.exit868 + %.not.i860 = icmp eq i64 %45, 0 + br i1 %.not.i860, label %panic.i861, label %__barray_mask_return.exit862 -panic.i867: ; preds = %__barray_mask_borrow.exit865 +panic.i861: ; preds = %__barray_mask_borrow.exit859 tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit868: ; preds = %__barray_mask_borrow.exit865 +__barray_mask_return.exit862: ; preds = %__barray_mask_borrow.exit859 %46 = xor i64 %44, 8 store i64 %46, i64* %11, align 4 store i64 %43, i64* %42, align 4 %47 = load i64, i64* %11, align 4 %48 = and i64 %47, 512 - %.not.i869 = icmp eq i64 %48, 0 - br i1 %.not.i869, label %__barray_mask_borrow.exit871, label %panic.i870 + %.not.i863 = icmp eq i64 %48, 0 + br i1 %.not.i863, label %__barray_mask_borrow.exit865, label %panic.i864 -panic.i870: ; preds = %__barray_mask_return.exit868 +panic.i864: ; preds = %__barray_mask_return.exit862 tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable -__barray_mask_borrow.exit871: ; preds = %__barray_mask_return.exit868 +__barray_mask_borrow.exit865: ; preds = %__barray_mask_return.exit862 %49 = xor i64 %47, 512 store i64 %49, i64* %11, align 4 %50 = getelementptr inbounds i8, i8* %8, i64 72 @@ -180,14 +180,14 @@ __barray_mask_borrow.exit871: ; preds = %__barray_mask_retur tail call void @___rxy(i64 %52, double 0x400921FB54442D18, double 0.000000e+00) %53 = load i64, i64* %11, align 4 %54 = and i64 %53, 512 - %.not.i872 = icmp eq i64 %54, 0 - br i1 %.not.i872, label %panic.i873, label %__barray_mask_return.exit874 + %.not.i866 = icmp eq i64 %54, 0 + br i1 %.not.i866, label %panic.i867, label %__barray_mask_return.exit868 -panic.i873: ; preds = %__barray_mask_borrow.exit871 +panic.i867: ; preds = %__barray_mask_borrow.exit865 tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit874: ; preds = %__barray_mask_borrow.exit871 +__barray_mask_return.exit868: ; preds = %__barray_mask_borrow.exit865 %55 = xor i64 %53, 512 store i64 %55, i64* %11, align 4 store i64 %52, i64* %51, align 4 @@ -223,13 +223,13 @@ mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @"e_Array cont.EFA5AC45.0", i64 0, i64 0)) unreachable -69: ; preds = %__barray_mask_return.exit874, %cond_exit_443.i - %"393_0.sroa.15.0.i963" = phi i64 [ 0, %__barray_mask_return.exit874 ], [ %70, %cond_exit_443.i ] - %70 = add nuw nsw i64 %"393_0.sroa.15.0.i963", 1 - %71 = lshr i64 %"393_0.sroa.15.0.i963", 6 +69: ; preds = %__barray_mask_return.exit868, %cond_exit_443.i + %"393_0.sroa.15.0.i957" = phi i64 [ 0, %__barray_mask_return.exit868 ], [ %70, %cond_exit_443.i ] + %70 = add nuw nsw i64 %"393_0.sroa.15.0.i957", 1 + %71 = lshr i64 %"393_0.sroa.15.0.i957", 6 %72 = getelementptr inbounds i64, i64* %11, i64 %71 %73 = load i64, i64* %72, align 4 - %74 = shl nuw nsw i64 1, %"393_0.sroa.15.0.i963" + %74 = shl nuw nsw i64 1, %"393_0.sroa.15.0.i957" %75 = and i64 %73, %74 %.not.i99.i.i = icmp eq i64 %75, 0 br i1 %.not.i99.i.i, label %__barray_check_bounds.exit.i, label %panic.i.i.i @@ -241,7 +241,7 @@ panic.i.i.i: ; preds = %69 __barray_check_bounds.exit.i: ; preds = %69 %76 = xor i64 %73, %74 store i64 %76, i64* %72, align 4 - %77 = getelementptr inbounds i64, i64* %9, i64 %"393_0.sroa.15.0.i963" + %77 = getelementptr inbounds i64, i64* %9, i64 %"393_0.sroa.15.0.i957" %78 = load i64, i64* %77, align 4 %lazy_measure.i = tail call i64 @___lazy_measure(i64 %78) tail call void @___qfree(i64 %78) @@ -259,10 +259,10 @@ cond_exit_443.i: ; preds = %__barray_check_boun %"457_054.fca.1.insert.i" = insertvalue { i1, i64, i1 } { i1 true, i64 poison, i1 poison }, i64 %lazy_measure.i, 1 %82 = xor i64 %80, %74 store i64 %82, i64* %79, align 4 - %83 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %57, i64 %"393_0.sroa.15.0.i963" + %83 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %57, i64 %"393_0.sroa.15.0.i957" store { i1, i64, i1 } %"457_054.fca.1.insert.i", { i1, i64, i1 }* %83, align 4 - %exitcond979.not = icmp eq i64 %70, 10 - br i1 %exitcond979.not, label %mask_block_ok.i.i.i, label %69 + %exitcond973.not = icmp eq i64 %70, 10 + br i1 %exitcond973.not, label %mask_block_ok.i.i.i, label %69 __barray_check_none_borrowed.exit: ; preds = %"__hugr__.$measure_array$$n(10).367.exit" %84 = tail call i8* @heap_alloc(i64 240) @@ -277,79 +277,79 @@ mask_block_err.i: ; preds = %"__hugr__.$measure_ tail call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable -89: ; preds = %__barray_check_none_borrowed.exit, %__hugr__.const_fun_290.309.exit - %storemerge850968 = phi i64 [ 0, %__barray_check_none_borrowed.exit ], [ %107, %__hugr__.const_fun_290.309.exit ] - %90 = phi i64 [ 0, %__barray_check_none_borrowed.exit ], [ %105, %__hugr__.const_fun_290.309.exit ] - %91 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %57, i64 %storemerge850968 +89: ; preds = %__barray_check_none_borrowed.exit, %__hugr__.const_fun_338.322.exit + %storemerge844962 = phi i64 [ 0, %__barray_check_none_borrowed.exit ], [ %107, %__hugr__.const_fun_338.322.exit ] + %90 = phi i64 [ 0, %__barray_check_none_borrowed.exit ], [ %105, %__hugr__.const_fun_338.322.exit ] + %91 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %57, i64 %storemerge844962 %92 = load { i1, i64, i1 }, { i1, i64, i1 }* %91, align 4 %.fca.0.extract118.i = extractvalue { i1, i64, i1 } %92, 0 %.fca.1.extract119.i = extractvalue { i1, i64, i1 } %92, 1 - br i1 %.fca.0.extract118.i, label %cond_525_case_1.i, label %cond_exit_525.i + br i1 %.fca.0.extract118.i, label %cond_513_case_1.i, label %cond_exit_513.i -cond_525_case_1.i: ; preds = %89 +cond_513_case_1.i: ; preds = %89 tail call void @___inc_future_refcount(i64 %.fca.1.extract119.i) %93 = insertvalue { i1, i64, i1 } { i1 true, i64 poison, i1 poison }, i64 %.fca.1.extract119.i, 1 - br label %cond_exit_525.i + br label %cond_exit_513.i -cond_exit_525.i: ; preds = %cond_525_case_1.i, %89 - %.pn.i = phi { i1, i64, i1 } [ %93, %cond_525_case_1.i ], [ %92, %89 ] +cond_exit_513.i: ; preds = %cond_513_case_1.i, %89 + %.pn.i = phi { i1, i64, i1 } [ %93, %cond_513_case_1.i ], [ %92, %89 ] %"04.sroa.6.0.i" = extractvalue { i1, i64, i1 } %.pn.i, 2 - %exitcond980.not = icmp eq i64 %storemerge850968, 10 - br i1 %exitcond980.not, label %cond_528_case_0.i, label %94 + %exitcond974.not = icmp eq i64 %storemerge844962, 10 + br i1 %exitcond974.not, label %cond_516_case_0.i, label %94 -94: ; preds = %cond_exit_525.i +94: ; preds = %cond_exit_513.i %95 = lshr i64 %90, 6 %96 = getelementptr inbounds i64, i64* %65, i64 %95 %97 = load i64, i64* %96, align 4 %98 = and i64 %90, 63 %99 = shl nuw i64 1, %98 %100 = and i64 %97, %99 - %.not.i.i876 = icmp eq i64 %100, 0 - br i1 %.not.i.i876, label %cond_528_case_1.i, label %panic.i.i877 + %.not.i.i870 = icmp eq i64 %100, 0 + br i1 %.not.i.i870, label %cond_516_case_1.i, label %panic.i.i871 -panic.i.i877: ; preds = %94 +panic.i.i871: ; preds = %94 tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable -cond_528_case_0.i: ; preds = %cond_exit_525.i +cond_516_case_0.i: ; preds = %cond_exit_513.i tail call void @panic(i32 1001, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @"e_Expected v.E6312129.0", i64 0, i64 0)) unreachable -cond_528_case_1.i: ; preds = %94 +cond_516_case_1.i: ; preds = %94 %"17.fca.2.insert.i" = insertvalue { i1, i64, i1 } %92, i1 %"04.sroa.6.0.i", 2 %101 = insertvalue { i1, { i1, i64, i1 } } { i1 true, { i1, i64, i1 } poison }, { i1, i64, i1 } %"17.fca.2.insert.i", 1 %102 = getelementptr inbounds { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %88, i64 %90 %103 = getelementptr inbounds { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %102, i64 0, i32 0 %104 = load i1, i1* %103, align 1 store { i1, { i1, i64, i1 } } %101, { i1, { i1, i64, i1 } }* %102, align 4 - br i1 %104, label %cond_529_case_1.i, label %__hugr__.const_fun_290.309.exit + br i1 %104, label %cond_517_case_1.i, label %__hugr__.const_fun_338.322.exit -cond_529_case_1.i: ; preds = %cond_528_case_1.i +cond_517_case_1.i: ; preds = %cond_516_case_1.i tail call void @panic(i32 1001, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @"e_Expected v.2F17E0A9.0", i64 0, i64 0)) unreachable -__hugr__.const_fun_290.309.exit: ; preds = %cond_528_case_1.i +__hugr__.const_fun_338.322.exit: ; preds = %cond_516_case_1.i %105 = add nuw nsw i64 %90, 1 - %106 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %85, i64 %storemerge850968 + %106 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %85, i64 %storemerge844962 store { i1, i64, i1 } %"17.fca.2.insert.i", { i1, i64, i1 }* %106, align 4 - %107 = add nuw nsw i64 %storemerge850968, 1 - %exitcond981.not = icmp eq i64 %107, 10 - br i1 %exitcond981.not, label %mask_block_ok.i881, label %89 + %107 = add nuw nsw i64 %storemerge844962, 1 + %exitcond975.not = icmp eq i64 %107, 10 + br i1 %exitcond975.not, label %mask_block_ok.i875, label %89 -mask_block_ok.i881: ; preds = %__hugr__.const_fun_290.309.exit +mask_block_ok.i875: ; preds = %__hugr__.const_fun_338.322.exit tail call void @heap_free(i8* nonnull %56) tail call void @heap_free(i8* %58) %108 = load i64, i64* %65, align 4 %109 = and i64 %108, 1023 store i64 %109, i64* %65, align 4 %110 = icmp eq i64 %109, 0 - br i1 %110, label %__barray_check_none_borrowed.exit883, label %mask_block_err.i882 + br i1 %110, label %__barray_check_none_borrowed.exit877, label %mask_block_err.i876 -mask_block_err.i882: ; preds = %mask_block_ok.i881 +mask_block_err.i876: ; preds = %mask_block_ok.i875 tail call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable -__barray_check_none_borrowed.exit883: ; preds = %mask_block_ok.i881 +__barray_check_none_borrowed.exit877: ; preds = %mask_block_ok.i875 %111 = tail call i8* @heap_alloc(i64 240) %112 = bitcast i8* %111 to { i1, i64, i1 }* %113 = tail call i8* @heap_alloc(i64 8) @@ -357,22 +357,22 @@ __barray_check_none_borrowed.exit883: ; preds = %mask_block_ok.i881 store i64 0, i64* %114, align 1 %115 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %88, align 4 %.fca.0.extract11.i = extractvalue { i1, { i1, i64, i1 } } %115, 0 - br i1 %.fca.0.extract11.i, label %__hugr__.const_fun_284.290.exit, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i, label %__hugr__.const_fun_287.338.exit, label %cond_558_case_0.i -cond_570_case_0.i: ; preds = %__hugr__.const_fun_284.290.exit.8, %__hugr__.const_fun_284.290.exit.7, %__hugr__.const_fun_284.290.exit.6, %__hugr__.const_fun_284.290.exit.5, %__hugr__.const_fun_284.290.exit.4, %__hugr__.const_fun_284.290.exit.3, %__hugr__.const_fun_284.290.exit.2, %__hugr__.const_fun_284.290.exit.1, %__hugr__.const_fun_284.290.exit, %__barray_check_none_borrowed.exit883 +cond_558_case_0.i: ; preds = %__hugr__.const_fun_287.338.exit.8, %__hugr__.const_fun_287.338.exit.7, %__hugr__.const_fun_287.338.exit.6, %__hugr__.const_fun_287.338.exit.5, %__hugr__.const_fun_287.338.exit.4, %__hugr__.const_fun_287.338.exit.3, %__hugr__.const_fun_287.338.exit.2, %__hugr__.const_fun_287.338.exit.1, %__hugr__.const_fun_287.338.exit, %__barray_check_none_borrowed.exit877 tail call void @panic(i32 1001, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @"e_Expected v.E6312129.0", i64 0, i64 0)) unreachable -__hugr__.const_fun_284.290.exit: ; preds = %__barray_check_none_borrowed.exit883 +__hugr__.const_fun_287.338.exit: ; preds = %__barray_check_none_borrowed.exit877 %116 = extractvalue { i1, { i1, i64, i1 } } %115, 1 store { i1, i64, i1 } %116, { i1, i64, i1 }* %112, align 4 %117 = getelementptr inbounds i8, i8* %63, i64 32 %118 = bitcast i8* %117 to { i1, { i1, i64, i1 } }* %119 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %118, align 4 %.fca.0.extract11.i.1 = extractvalue { i1, { i1, i64, i1 } } %119, 0 - br i1 %.fca.0.extract11.i.1, label %__hugr__.const_fun_284.290.exit.1, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.1, label %__hugr__.const_fun_287.338.exit.1, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.1: ; preds = %__hugr__.const_fun_284.290.exit +__hugr__.const_fun_287.338.exit.1: ; preds = %__hugr__.const_fun_287.338.exit %120 = extractvalue { i1, { i1, i64, i1 } } %119, 1 %121 = getelementptr inbounds i8, i8* %111, i64 24 %122 = bitcast i8* %121 to { i1, i64, i1 }* @@ -381,9 +381,9 @@ __hugr__.const_fun_284.290.exit.1: ; preds = %__hugr__.const_fun_ %124 = bitcast i8* %123 to { i1, { i1, i64, i1 } }* %125 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %124, align 4 %.fca.0.extract11.i.2 = extractvalue { i1, { i1, i64, i1 } } %125, 0 - br i1 %.fca.0.extract11.i.2, label %__hugr__.const_fun_284.290.exit.2, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.2, label %__hugr__.const_fun_287.338.exit.2, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.2: ; preds = %__hugr__.const_fun_284.290.exit.1 +__hugr__.const_fun_287.338.exit.2: ; preds = %__hugr__.const_fun_287.338.exit.1 %126 = extractvalue { i1, { i1, i64, i1 } } %125, 1 %127 = getelementptr inbounds i8, i8* %111, i64 48 %128 = bitcast i8* %127 to { i1, i64, i1 }* @@ -392,9 +392,9 @@ __hugr__.const_fun_284.290.exit.2: ; preds = %__hugr__.const_fun_ %130 = bitcast i8* %129 to { i1, { i1, i64, i1 } }* %131 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %130, align 4 %.fca.0.extract11.i.3 = extractvalue { i1, { i1, i64, i1 } } %131, 0 - br i1 %.fca.0.extract11.i.3, label %__hugr__.const_fun_284.290.exit.3, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.3, label %__hugr__.const_fun_287.338.exit.3, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.3: ; preds = %__hugr__.const_fun_284.290.exit.2 +__hugr__.const_fun_287.338.exit.3: ; preds = %__hugr__.const_fun_287.338.exit.2 %132 = extractvalue { i1, { i1, i64, i1 } } %131, 1 %133 = getelementptr inbounds i8, i8* %111, i64 72 %134 = bitcast i8* %133 to { i1, i64, i1 }* @@ -403,9 +403,9 @@ __hugr__.const_fun_284.290.exit.3: ; preds = %__hugr__.const_fun_ %136 = bitcast i8* %135 to { i1, { i1, i64, i1 } }* %137 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %136, align 4 %.fca.0.extract11.i.4 = extractvalue { i1, { i1, i64, i1 } } %137, 0 - br i1 %.fca.0.extract11.i.4, label %__hugr__.const_fun_284.290.exit.4, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.4, label %__hugr__.const_fun_287.338.exit.4, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.4: ; preds = %__hugr__.const_fun_284.290.exit.3 +__hugr__.const_fun_287.338.exit.4: ; preds = %__hugr__.const_fun_287.338.exit.3 %138 = extractvalue { i1, { i1, i64, i1 } } %137, 1 %139 = getelementptr inbounds i8, i8* %111, i64 96 %140 = bitcast i8* %139 to { i1, i64, i1 }* @@ -414,9 +414,9 @@ __hugr__.const_fun_284.290.exit.4: ; preds = %__hugr__.const_fun_ %142 = bitcast i8* %141 to { i1, { i1, i64, i1 } }* %143 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %142, align 4 %.fca.0.extract11.i.5 = extractvalue { i1, { i1, i64, i1 } } %143, 0 - br i1 %.fca.0.extract11.i.5, label %__hugr__.const_fun_284.290.exit.5, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.5, label %__hugr__.const_fun_287.338.exit.5, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.5: ; preds = %__hugr__.const_fun_284.290.exit.4 +__hugr__.const_fun_287.338.exit.5: ; preds = %__hugr__.const_fun_287.338.exit.4 %144 = extractvalue { i1, { i1, i64, i1 } } %143, 1 %145 = getelementptr inbounds i8, i8* %111, i64 120 %146 = bitcast i8* %145 to { i1, i64, i1 }* @@ -425,9 +425,9 @@ __hugr__.const_fun_284.290.exit.5: ; preds = %__hugr__.const_fun_ %148 = bitcast i8* %147 to { i1, { i1, i64, i1 } }* %149 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %148, align 4 %.fca.0.extract11.i.6 = extractvalue { i1, { i1, i64, i1 } } %149, 0 - br i1 %.fca.0.extract11.i.6, label %__hugr__.const_fun_284.290.exit.6, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.6, label %__hugr__.const_fun_287.338.exit.6, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.6: ; preds = %__hugr__.const_fun_284.290.exit.5 +__hugr__.const_fun_287.338.exit.6: ; preds = %__hugr__.const_fun_287.338.exit.5 %150 = extractvalue { i1, { i1, i64, i1 } } %149, 1 %151 = getelementptr inbounds i8, i8* %111, i64 144 %152 = bitcast i8* %151 to { i1, i64, i1 }* @@ -436,9 +436,9 @@ __hugr__.const_fun_284.290.exit.6: ; preds = %__hugr__.const_fun_ %154 = bitcast i8* %153 to { i1, { i1, i64, i1 } }* %155 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %154, align 4 %.fca.0.extract11.i.7 = extractvalue { i1, { i1, i64, i1 } } %155, 0 - br i1 %.fca.0.extract11.i.7, label %__hugr__.const_fun_284.290.exit.7, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.7, label %__hugr__.const_fun_287.338.exit.7, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.7: ; preds = %__hugr__.const_fun_284.290.exit.6 +__hugr__.const_fun_287.338.exit.7: ; preds = %__hugr__.const_fun_287.338.exit.6 %156 = extractvalue { i1, { i1, i64, i1 } } %155, 1 %157 = getelementptr inbounds i8, i8* %111, i64 168 %158 = bitcast i8* %157 to { i1, i64, i1 }* @@ -447,9 +447,9 @@ __hugr__.const_fun_284.290.exit.7: ; preds = %__hugr__.const_fun_ %160 = bitcast i8* %159 to { i1, { i1, i64, i1 } }* %161 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %160, align 4 %.fca.0.extract11.i.8 = extractvalue { i1, { i1, i64, i1 } } %161, 0 - br i1 %.fca.0.extract11.i.8, label %__hugr__.const_fun_284.290.exit.8, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.8, label %__hugr__.const_fun_287.338.exit.8, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.8: ; preds = %__hugr__.const_fun_284.290.exit.7 +__hugr__.const_fun_287.338.exit.8: ; preds = %__hugr__.const_fun_287.338.exit.7 %162 = extractvalue { i1, { i1, i64, i1 } } %161, 1 %163 = getelementptr inbounds i8, i8* %111, i64 192 %164 = bitcast i8* %163 to { i1, i64, i1 }* @@ -458,86 +458,86 @@ __hugr__.const_fun_284.290.exit.8: ; preds = %__hugr__.const_fun_ %166 = bitcast i8* %165 to { i1, { i1, i64, i1 } }* %167 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %166, align 4 %.fca.0.extract11.i.9 = extractvalue { i1, { i1, i64, i1 } } %167, 0 - br i1 %.fca.0.extract11.i.9, label %__hugr__.const_fun_284.290.exit.9, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.9, label %__hugr__.const_fun_287.338.exit.9, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.9: ; preds = %__hugr__.const_fun_284.290.exit.8 +__hugr__.const_fun_287.338.exit.9: ; preds = %__hugr__.const_fun_287.338.exit.8 %168 = extractvalue { i1, { i1, i64, i1 } } %167, 1 %169 = getelementptr inbounds i8, i8* %111, i64 216 %170 = bitcast i8* %169 to { i1, i64, i1 }* store { i1, i64, i1 } %168, { i1, i64, i1 }* %170, align 4 tail call void @heap_free(i8* nonnull %63) tail call void @heap_free(i8* nonnull %64) - br label %__barray_check_bounds.exit888 + br label %__barray_check_bounds.exit882 -cond_165_case_0: ; preds = %cond_exit_165 +cond_169_case_0: ; preds = %cond_exit_169 %171 = load i64, i64* %114, align 4 %172 = or i64 %171, -1024 store i64 %172, i64* %114, align 4 %173 = icmp eq i64 %172, -1 - br i1 %173, label %loop_out139, label %mask_block_err.i886 + br i1 %173, label %loop_out135, label %mask_block_err.i880 -mask_block_err.i886: ; preds = %cond_165_case_0 +mask_block_err.i880: ; preds = %cond_169_case_0 tail call void @panic(i32 1002, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @"e_Array cont.EFA5AC45.0", i64 0, i64 0)) unreachable -__barray_check_bounds.exit888: ; preds = %__hugr__.const_fun_284.290.exit.9, %cond_exit_165 - %"167_0.0990" = phi i64 [ 0, %__hugr__.const_fun_284.290.exit.9 ], [ %174, %cond_exit_165 ] - %174 = add nuw nsw i64 %"167_0.0990", 1 - %175 = lshr i64 %"167_0.0990", 6 +__barray_check_bounds.exit882: ; preds = %__hugr__.const_fun_287.338.exit.9, %cond_exit_169 + %"172_0.0984" = phi i64 [ 0, %__hugr__.const_fun_287.338.exit.9 ], [ %174, %cond_exit_169 ] + %174 = add nuw nsw i64 %"172_0.0984", 1 + %175 = lshr i64 %"172_0.0984", 6 %176 = getelementptr inbounds i64, i64* %114, i64 %175 %177 = load i64, i64* %176, align 4 - %178 = shl nuw nsw i64 1, %"167_0.0990" + %178 = shl nuw nsw i64 1, %"172_0.0984" %179 = and i64 %177, %178 %.not = icmp eq i64 %179, 0 - br i1 %.not, label %__barray_mask_borrow.exit893, label %cond_exit_165 + br i1 %.not, label %__barray_mask_borrow.exit887, label %cond_exit_169 -__barray_mask_borrow.exit893: ; preds = %__barray_check_bounds.exit888 +__barray_mask_borrow.exit887: ; preds = %__barray_check_bounds.exit882 %180 = xor i64 %177, %178 store i64 %180, i64* %176, align 4 - %181 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %112, i64 %"167_0.0990" + %181 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %112, i64 %"172_0.0984" %182 = load { i1, i64, i1 }, { i1, i64, i1 }* %181, align 4 - %.fca.0.extract511 = extractvalue { i1, i64, i1 } %182, 0 - br i1 %.fca.0.extract511, label %cond_501_case_1, label %cond_exit_165 + %.fca.0.extract505 = extractvalue { i1, i64, i1 } %182, 0 + br i1 %.fca.0.extract505, label %cond_496_case_1, label %cond_exit_169 -cond_exit_165: ; preds = %cond_501_case_1, %__barray_mask_borrow.exit893, %__barray_check_bounds.exit888 - %183 = icmp ult i64 %"167_0.0990", 9 - br i1 %183, label %__barray_check_bounds.exit888, label %cond_165_case_0 +cond_exit_169: ; preds = %cond_496_case_1, %__barray_mask_borrow.exit887, %__barray_check_bounds.exit882 + %183 = icmp ult i64 %"172_0.0984", 9 + br i1 %183, label %__barray_check_bounds.exit882, label %cond_169_case_0 -loop_out139: ; preds = %cond_165_case_0 +loop_out135: ; preds = %cond_169_case_0 tail call void @heap_free(i8* %111) tail call void @heap_free(i8* nonnull %113) %184 = load i64, i64* %87, align 4 %185 = and i64 %184, 1023 store i64 %185, i64* %87, align 4 %186 = icmp eq i64 %185, 0 - br i1 %186, label %__barray_check_none_borrowed.exit898, label %mask_block_err.i897 + br i1 %186, label %__barray_check_none_borrowed.exit892, label %mask_block_err.i891 -__barray_check_none_borrowed.exit898: ; preds = %loop_out139 +__barray_check_none_borrowed.exit892: ; preds = %loop_out135 %187 = tail call i8* @heap_alloc(i64 10) %188 = tail call i8* @heap_alloc(i64 8) %189 = bitcast i8* %188 to i64* store i64 0, i64* %189, align 1 %190 = load { i1, i64, i1 }, { i1, i64, i1 }* %85, align 4 - %.fca.0.extract.i899 = extractvalue { i1, i64, i1 } %190, 0 - %.fca.1.extract.i900 = extractvalue { i1, i64, i1 } %190, 1 - br i1 %.fca.0.extract.i899, label %cond_300_case_1.i, label %cond_300_case_0.i + %.fca.0.extract.i893 = extractvalue { i1, i64, i1 } %190, 0 + %.fca.1.extract.i894 = extractvalue { i1, i64, i1 } %190, 1 + br i1 %.fca.0.extract.i893, label %cond_300_case_1.i, label %cond_300_case_0.i -mask_block_err.i897: ; preds = %loop_out139 +mask_block_err.i891: ; preds = %loop_out135 tail call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable -cond_501_case_1: ; preds = %__barray_mask_borrow.exit893 - %.fca.1.extract512 = extractvalue { i1, i64, i1 } %182, 1 - tail call void @___dec_future_refcount(i64 %.fca.1.extract512) - br label %cond_exit_165 +cond_496_case_1: ; preds = %__barray_mask_borrow.exit887 + %.fca.1.extract506 = extractvalue { i1, i64, i1 } %182, 1 + tail call void @___dec_future_refcount(i64 %.fca.1.extract506) + br label %cond_exit_169 -cond_300_case_0.i: ; preds = %__barray_check_none_borrowed.exit898 +cond_300_case_0.i: ; preds = %__barray_check_none_borrowed.exit892 %.fca.2.extract.i = extractvalue { i1, i64, i1 } %190, 2 br label %__hugr__.array.__read_bool.3.271.exit -cond_300_case_1.i: ; preds = %__barray_check_none_borrowed.exit898 - %read_bool.i = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900) +cond_300_case_1.i: ; preds = %__barray_check_none_borrowed.exit892 + %read_bool.i = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894) br label %__hugr__.array.__read_bool.3.271.exit __hugr__.array.__read_bool.3.271.exit: ; preds = %cond_300_case_0.i, %cond_300_case_1.i @@ -547,17 +547,17 @@ __hugr__.array.__read_bool.3.271.exit: ; preds = %cond_300_case_0.i, %192 = getelementptr inbounds i8, i8* %84, i64 24 %193 = bitcast i8* %192 to { i1, i64, i1 }* %194 = load { i1, i64, i1 }, { i1, i64, i1 }* %193, align 4 - %.fca.0.extract.i899.1 = extractvalue { i1, i64, i1 } %194, 0 - %.fca.1.extract.i900.1 = extractvalue { i1, i64, i1 } %194, 1 - br i1 %.fca.0.extract.i899.1, label %cond_300_case_1.i.1, label %cond_300_case_0.i.1 + %.fca.0.extract.i893.1 = extractvalue { i1, i64, i1 } %194, 0 + %.fca.1.extract.i894.1 = extractvalue { i1, i64, i1 } %194, 1 + br i1 %.fca.0.extract.i893.1, label %cond_300_case_1.i.1, label %cond_300_case_0.i.1 cond_300_case_0.i.1: ; preds = %__hugr__.array.__read_bool.3.271.exit %.fca.2.extract.i.1 = extractvalue { i1, i64, i1 } %194, 2 br label %__hugr__.array.__read_bool.3.271.exit.1 cond_300_case_1.i.1: ; preds = %__hugr__.array.__read_bool.3.271.exit - %read_bool.i.1 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.1) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.1) + %read_bool.i.1 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.1) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.1) br label %__hugr__.array.__read_bool.3.271.exit.1 __hugr__.array.__read_bool.3.271.exit.1: ; preds = %cond_300_case_1.i.1, %cond_300_case_0.i.1 @@ -568,17 +568,17 @@ __hugr__.array.__read_bool.3.271.exit.1: ; preds = %cond_300_case_1.i.1 %197 = getelementptr inbounds i8, i8* %84, i64 48 %198 = bitcast i8* %197 to { i1, i64, i1 }* %199 = load { i1, i64, i1 }, { i1, i64, i1 }* %198, align 4 - %.fca.0.extract.i899.2 = extractvalue { i1, i64, i1 } %199, 0 - %.fca.1.extract.i900.2 = extractvalue { i1, i64, i1 } %199, 1 - br i1 %.fca.0.extract.i899.2, label %cond_300_case_1.i.2, label %cond_300_case_0.i.2 + %.fca.0.extract.i893.2 = extractvalue { i1, i64, i1 } %199, 0 + %.fca.1.extract.i894.2 = extractvalue { i1, i64, i1 } %199, 1 + br i1 %.fca.0.extract.i893.2, label %cond_300_case_1.i.2, label %cond_300_case_0.i.2 cond_300_case_0.i.2: ; preds = %__hugr__.array.__read_bool.3.271.exit.1 %.fca.2.extract.i.2 = extractvalue { i1, i64, i1 } %199, 2 br label %__hugr__.array.__read_bool.3.271.exit.2 cond_300_case_1.i.2: ; preds = %__hugr__.array.__read_bool.3.271.exit.1 - %read_bool.i.2 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.2) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.2) + %read_bool.i.2 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.2) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.2) br label %__hugr__.array.__read_bool.3.271.exit.2 __hugr__.array.__read_bool.3.271.exit.2: ; preds = %cond_300_case_1.i.2, %cond_300_case_0.i.2 @@ -589,17 +589,17 @@ __hugr__.array.__read_bool.3.271.exit.2: ; preds = %cond_300_case_1.i.2 %202 = getelementptr inbounds i8, i8* %84, i64 72 %203 = bitcast i8* %202 to { i1, i64, i1 }* %204 = load { i1, i64, i1 }, { i1, i64, i1 }* %203, align 4 - %.fca.0.extract.i899.3 = extractvalue { i1, i64, i1 } %204, 0 - %.fca.1.extract.i900.3 = extractvalue { i1, i64, i1 } %204, 1 - br i1 %.fca.0.extract.i899.3, label %cond_300_case_1.i.3, label %cond_300_case_0.i.3 + %.fca.0.extract.i893.3 = extractvalue { i1, i64, i1 } %204, 0 + %.fca.1.extract.i894.3 = extractvalue { i1, i64, i1 } %204, 1 + br i1 %.fca.0.extract.i893.3, label %cond_300_case_1.i.3, label %cond_300_case_0.i.3 cond_300_case_0.i.3: ; preds = %__hugr__.array.__read_bool.3.271.exit.2 %.fca.2.extract.i.3 = extractvalue { i1, i64, i1 } %204, 2 br label %__hugr__.array.__read_bool.3.271.exit.3 cond_300_case_1.i.3: ; preds = %__hugr__.array.__read_bool.3.271.exit.2 - %read_bool.i.3 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.3) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.3) + %read_bool.i.3 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.3) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.3) br label %__hugr__.array.__read_bool.3.271.exit.3 __hugr__.array.__read_bool.3.271.exit.3: ; preds = %cond_300_case_1.i.3, %cond_300_case_0.i.3 @@ -610,17 +610,17 @@ __hugr__.array.__read_bool.3.271.exit.3: ; preds = %cond_300_case_1.i.3 %207 = getelementptr inbounds i8, i8* %84, i64 96 %208 = bitcast i8* %207 to { i1, i64, i1 }* %209 = load { i1, i64, i1 }, { i1, i64, i1 }* %208, align 4 - %.fca.0.extract.i899.4 = extractvalue { i1, i64, i1 } %209, 0 - %.fca.1.extract.i900.4 = extractvalue { i1, i64, i1 } %209, 1 - br i1 %.fca.0.extract.i899.4, label %cond_300_case_1.i.4, label %cond_300_case_0.i.4 + %.fca.0.extract.i893.4 = extractvalue { i1, i64, i1 } %209, 0 + %.fca.1.extract.i894.4 = extractvalue { i1, i64, i1 } %209, 1 + br i1 %.fca.0.extract.i893.4, label %cond_300_case_1.i.4, label %cond_300_case_0.i.4 cond_300_case_0.i.4: ; preds = %__hugr__.array.__read_bool.3.271.exit.3 %.fca.2.extract.i.4 = extractvalue { i1, i64, i1 } %209, 2 br label %__hugr__.array.__read_bool.3.271.exit.4 cond_300_case_1.i.4: ; preds = %__hugr__.array.__read_bool.3.271.exit.3 - %read_bool.i.4 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.4) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.4) + %read_bool.i.4 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.4) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.4) br label %__hugr__.array.__read_bool.3.271.exit.4 __hugr__.array.__read_bool.3.271.exit.4: ; preds = %cond_300_case_1.i.4, %cond_300_case_0.i.4 @@ -631,17 +631,17 @@ __hugr__.array.__read_bool.3.271.exit.4: ; preds = %cond_300_case_1.i.4 %212 = getelementptr inbounds i8, i8* %84, i64 120 %213 = bitcast i8* %212 to { i1, i64, i1 }* %214 = load { i1, i64, i1 }, { i1, i64, i1 }* %213, align 4 - %.fca.0.extract.i899.5 = extractvalue { i1, i64, i1 } %214, 0 - %.fca.1.extract.i900.5 = extractvalue { i1, i64, i1 } %214, 1 - br i1 %.fca.0.extract.i899.5, label %cond_300_case_1.i.5, label %cond_300_case_0.i.5 + %.fca.0.extract.i893.5 = extractvalue { i1, i64, i1 } %214, 0 + %.fca.1.extract.i894.5 = extractvalue { i1, i64, i1 } %214, 1 + br i1 %.fca.0.extract.i893.5, label %cond_300_case_1.i.5, label %cond_300_case_0.i.5 cond_300_case_0.i.5: ; preds = %__hugr__.array.__read_bool.3.271.exit.4 %.fca.2.extract.i.5 = extractvalue { i1, i64, i1 } %214, 2 br label %__hugr__.array.__read_bool.3.271.exit.5 cond_300_case_1.i.5: ; preds = %__hugr__.array.__read_bool.3.271.exit.4 - %read_bool.i.5 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.5) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.5) + %read_bool.i.5 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.5) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.5) br label %__hugr__.array.__read_bool.3.271.exit.5 __hugr__.array.__read_bool.3.271.exit.5: ; preds = %cond_300_case_1.i.5, %cond_300_case_0.i.5 @@ -652,17 +652,17 @@ __hugr__.array.__read_bool.3.271.exit.5: ; preds = %cond_300_case_1.i.5 %217 = getelementptr inbounds i8, i8* %84, i64 144 %218 = bitcast i8* %217 to { i1, i64, i1 }* %219 = load { i1, i64, i1 }, { i1, i64, i1 }* %218, align 4 - %.fca.0.extract.i899.6 = extractvalue { i1, i64, i1 } %219, 0 - %.fca.1.extract.i900.6 = extractvalue { i1, i64, i1 } %219, 1 - br i1 %.fca.0.extract.i899.6, label %cond_300_case_1.i.6, label %cond_300_case_0.i.6 + %.fca.0.extract.i893.6 = extractvalue { i1, i64, i1 } %219, 0 + %.fca.1.extract.i894.6 = extractvalue { i1, i64, i1 } %219, 1 + br i1 %.fca.0.extract.i893.6, label %cond_300_case_1.i.6, label %cond_300_case_0.i.6 cond_300_case_0.i.6: ; preds = %__hugr__.array.__read_bool.3.271.exit.5 %.fca.2.extract.i.6 = extractvalue { i1, i64, i1 } %219, 2 br label %__hugr__.array.__read_bool.3.271.exit.6 cond_300_case_1.i.6: ; preds = %__hugr__.array.__read_bool.3.271.exit.5 - %read_bool.i.6 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.6) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.6) + %read_bool.i.6 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.6) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.6) br label %__hugr__.array.__read_bool.3.271.exit.6 __hugr__.array.__read_bool.3.271.exit.6: ; preds = %cond_300_case_1.i.6, %cond_300_case_0.i.6 @@ -673,17 +673,17 @@ __hugr__.array.__read_bool.3.271.exit.6: ; preds = %cond_300_case_1.i.6 %222 = getelementptr inbounds i8, i8* %84, i64 168 %223 = bitcast i8* %222 to { i1, i64, i1 }* %224 = load { i1, i64, i1 }, { i1, i64, i1 }* %223, align 4 - %.fca.0.extract.i899.7 = extractvalue { i1, i64, i1 } %224, 0 - %.fca.1.extract.i900.7 = extractvalue { i1, i64, i1 } %224, 1 - br i1 %.fca.0.extract.i899.7, label %cond_300_case_1.i.7, label %cond_300_case_0.i.7 + %.fca.0.extract.i893.7 = extractvalue { i1, i64, i1 } %224, 0 + %.fca.1.extract.i894.7 = extractvalue { i1, i64, i1 } %224, 1 + br i1 %.fca.0.extract.i893.7, label %cond_300_case_1.i.7, label %cond_300_case_0.i.7 cond_300_case_0.i.7: ; preds = %__hugr__.array.__read_bool.3.271.exit.6 %.fca.2.extract.i.7 = extractvalue { i1, i64, i1 } %224, 2 br label %__hugr__.array.__read_bool.3.271.exit.7 cond_300_case_1.i.7: ; preds = %__hugr__.array.__read_bool.3.271.exit.6 - %read_bool.i.7 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.7) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.7) + %read_bool.i.7 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.7) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.7) br label %__hugr__.array.__read_bool.3.271.exit.7 __hugr__.array.__read_bool.3.271.exit.7: ; preds = %cond_300_case_1.i.7, %cond_300_case_0.i.7 @@ -694,17 +694,17 @@ __hugr__.array.__read_bool.3.271.exit.7: ; preds = %cond_300_case_1.i.7 %227 = getelementptr inbounds i8, i8* %84, i64 192 %228 = bitcast i8* %227 to { i1, i64, i1 }* %229 = load { i1, i64, i1 }, { i1, i64, i1 }* %228, align 4 - %.fca.0.extract.i899.8 = extractvalue { i1, i64, i1 } %229, 0 - %.fca.1.extract.i900.8 = extractvalue { i1, i64, i1 } %229, 1 - br i1 %.fca.0.extract.i899.8, label %cond_300_case_1.i.8, label %cond_300_case_0.i.8 + %.fca.0.extract.i893.8 = extractvalue { i1, i64, i1 } %229, 0 + %.fca.1.extract.i894.8 = extractvalue { i1, i64, i1 } %229, 1 + br i1 %.fca.0.extract.i893.8, label %cond_300_case_1.i.8, label %cond_300_case_0.i.8 cond_300_case_0.i.8: ; preds = %__hugr__.array.__read_bool.3.271.exit.7 %.fca.2.extract.i.8 = extractvalue { i1, i64, i1 } %229, 2 br label %__hugr__.array.__read_bool.3.271.exit.8 cond_300_case_1.i.8: ; preds = %__hugr__.array.__read_bool.3.271.exit.7 - %read_bool.i.8 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.8) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.8) + %read_bool.i.8 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.8) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.8) br label %__hugr__.array.__read_bool.3.271.exit.8 __hugr__.array.__read_bool.3.271.exit.8: ; preds = %cond_300_case_1.i.8, %cond_300_case_0.i.8 @@ -715,17 +715,17 @@ __hugr__.array.__read_bool.3.271.exit.8: ; preds = %cond_300_case_1.i.8 %232 = getelementptr inbounds i8, i8* %84, i64 216 %233 = bitcast i8* %232 to { i1, i64, i1 }* %234 = load { i1, i64, i1 }, { i1, i64, i1 }* %233, align 4 - %.fca.0.extract.i899.9 = extractvalue { i1, i64, i1 } %234, 0 - %.fca.1.extract.i900.9 = extractvalue { i1, i64, i1 } %234, 1 - br i1 %.fca.0.extract.i899.9, label %cond_300_case_1.i.9, label %cond_300_case_0.i.9 + %.fca.0.extract.i893.9 = extractvalue { i1, i64, i1 } %234, 0 + %.fca.1.extract.i894.9 = extractvalue { i1, i64, i1 } %234, 1 + br i1 %.fca.0.extract.i893.9, label %cond_300_case_1.i.9, label %cond_300_case_0.i.9 cond_300_case_0.i.9: ; preds = %__hugr__.array.__read_bool.3.271.exit.8 %.fca.2.extract.i.9 = extractvalue { i1, i64, i1 } %234, 2 br label %__hugr__.array.__read_bool.3.271.exit.9 cond_300_case_1.i.9: ; preds = %__hugr__.array.__read_bool.3.271.exit.8 - %read_bool.i.9 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.9) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.9) + %read_bool.i.9 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.9) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.9) br label %__hugr__.array.__read_bool.3.271.exit.9 __hugr__.array.__read_bool.3.271.exit.9: ; preds = %cond_300_case_1.i.9, %cond_300_case_0.i.9 @@ -739,9 +739,9 @@ __hugr__.array.__read_bool.3.271.exit.9: ; preds = %cond_300_case_1.i.9 %238 = and i64 %237, 1023 store i64 %238, i64* %189, align 4 %239 = icmp eq i64 %238, 0 - br i1 %239, label %__barray_check_none_borrowed.exit905, label %mask_block_err.i904 + br i1 %239, label %__barray_check_none_borrowed.exit899, label %mask_block_err.i898 -__barray_check_none_borrowed.exit905: ; preds = %__hugr__.array.__read_bool.3.271.exit.9 +__barray_check_none_borrowed.exit899: ; preds = %__hugr__.array.__read_bool.3.271.exit.9 %out_arr_alloca = alloca <{ i32, i32, i1*, i1* }>, align 8 %x_ptr = getelementptr inbounds <{ i32, i32, i1*, i1* }>, <{ i32, i32, i1*, i1* }>* %out_arr_alloca, i64 0, i32 0 %y_ptr = getelementptr inbounds <{ i32, i32, i1*, i1* }>, <{ i32, i32, i1*, i1* }>* %out_arr_alloca, i64 0, i32 1 @@ -757,37 +757,37 @@ __barray_check_none_borrowed.exit905: ; preds = %__hugr__.array.__re store i8* %187, i8** %242, align 8 store i1* %.sub, i1** %mask_ptr, align 8 call void @print_bool_arr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @res_cs.46C3C4B5.0, i64 0, i64 0), i64 15, <{ i32, i32, i1*, i1* }>* nonnull %out_arr_alloca) - br label %__barray_check_bounds.exit913 + br label %__barray_check_bounds.exit907 -mask_block_err.i904: ; preds = %__hugr__.array.__read_bool.3.271.exit.9 +mask_block_err.i898: ; preds = %__hugr__.array.__read_bool.3.271.exit.9 tail call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable -__barray_check_bounds.exit913: ; preds = %cond_exit_95, %__barray_check_none_borrowed.exit905 - %"90_0.sroa.0.0972" = phi i64 [ 0, %__barray_check_none_borrowed.exit905 ], [ %243, %cond_exit_95 ] - %243 = add nuw nsw i64 %"90_0.sroa.0.0972", 1 - %244 = lshr i64 %"90_0.sroa.0.0972", 6 +__barray_check_bounds.exit907: ; preds = %cond_exit_95, %__barray_check_none_borrowed.exit899 + %"90_0.sroa.0.0966" = phi i64 [ 0, %__barray_check_none_borrowed.exit899 ], [ %243, %cond_exit_95 ] + %243 = add nuw nsw i64 %"90_0.sroa.0.0966", 1 + %244 = lshr i64 %"90_0.sroa.0.0966", 6 %245 = getelementptr inbounds i64, i64* %7, i64 %244 %246 = load i64, i64* %245, align 4 - %247 = and i64 %"90_0.sroa.0.0972", 63 + %247 = and i64 %"90_0.sroa.0.0966", 63 %248 = shl nuw i64 1, %247 %249 = and i64 %246, %248 - %.not.i914 = icmp eq i64 %249, 0 - br i1 %.not.i914, label %panic.i915, label %cond_exit_95 + %.not.i908 = icmp eq i64 %249, 0 + br i1 %.not.i908, label %panic.i909, label %cond_exit_95 -panic.i915: ; preds = %__barray_check_bounds.exit913 +panic.i909: ; preds = %__barray_check_bounds.exit907 call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -cond_exit_95: ; preds = %__barray_check_bounds.exit913 +cond_exit_95: ; preds = %__barray_check_bounds.exit907 %250 = xor i64 %246, %248 store i64 %250, i64* %245, align 4 - %251 = getelementptr inbounds i64, i64* %5, i64 %"90_0.sroa.0.0972" - store i64 %"90_0.sroa.0.0972", i64* %251, align 4 - %exitcond984.not = icmp eq i64 %243, 100 - br i1 %exitcond984.not, label %loop_out212, label %__barray_check_bounds.exit913 + %251 = getelementptr inbounds i64, i64* %5, i64 %"90_0.sroa.0.0966" + store i64 %"90_0.sroa.0.0966", i64* %251, align 4 + %exitcond978.not = icmp eq i64 %243, 100 + br i1 %exitcond978.not, label %loop_out208, label %__barray_check_bounds.exit907 -loop_out212: ; preds = %cond_exit_95 +loop_out208: ; preds = %cond_exit_95 %252 = getelementptr inbounds i8, i8* %6, i64 8 %253 = bitcast i8* %252 to i64* %254 = load i64, i64* %253, align 4 @@ -797,9 +797,9 @@ loop_out212: ; preds = %cond_exit_95 %257 = icmp eq i64 %256, 0 %258 = icmp eq i64 %255, 0 %or.cond = select i1 %257, i1 %258, i1 false - br i1 %or.cond, label %__barray_check_none_borrowed.exit921, label %mask_block_err.i920 + br i1 %or.cond, label %__barray_check_none_borrowed.exit915, label %mask_block_err.i914 -__barray_check_none_borrowed.exit921: ; preds = %loop_out212 +__barray_check_none_borrowed.exit915: ; preds = %loop_out208 %259 = call i8* @heap_alloc(i64 800) %260 = bitcast i8* %259 to i64* %261 = call i8* @heap_alloc(i64 16) @@ -813,62 +813,62 @@ __barray_check_none_borrowed.exit921: ; preds = %loop_out212 %265 = load i64, i64* %7, align 4 %266 = icmp eq i64 %265, 0 %267 = icmp eq i64 %264, 0 - %or.cond987 = select i1 %266, i1 %267, i1 false - br i1 %or.cond987, label %__barray_check_none_borrowed.exit926, label %mask_block_err.i925 + %or.cond981 = select i1 %266, i1 %267, i1 false + br i1 %or.cond981, label %__barray_check_none_borrowed.exit920, label %mask_block_err.i919 -mask_block_err.i920: ; preds = %loop_out212 +mask_block_err.i914: ; preds = %loop_out208 call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable -__barray_check_none_borrowed.exit926: ; preds = %__barray_check_none_borrowed.exit921 - %out_arr_alloca287 = alloca <{ i32, i32, i64*, i1* }>, align 8 - %x_ptr288 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca287, i64 0, i32 0 - %y_ptr289 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca287, i64 0, i32 1 - %arr_ptr290 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca287, i64 0, i32 2 - %mask_ptr291 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca287, i64 0, i32 3 +__barray_check_none_borrowed.exit920: ; preds = %__barray_check_none_borrowed.exit915 + %out_arr_alloca282 = alloca <{ i32, i32, i64*, i1* }>, align 8 + %x_ptr283 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca282, i64 0, i32 0 + %y_ptr284 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca282, i64 0, i32 1 + %arr_ptr285 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca282, i64 0, i32 2 + %mask_ptr286 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca282, i64 0, i32 3 %268 = alloca [100 x i1], align 1 - %.sub635 = getelementptr inbounds [100 x i1], [100 x i1]* %268, i64 0, i64 0 + %.sub629 = getelementptr inbounds [100 x i1], [100 x i1]* %268, i64 0, i64 0 %269 = bitcast [100 x i1]* %268 to i8* call void @llvm.memset.p0i8.i64(i8* noundef nonnull align 1 dereferenceable(100) %269, i8 0, i64 100, i1 false) - store i32 100, i32* %x_ptr288, align 8 - store i32 1, i32* %y_ptr289, align 4 - %270 = bitcast i64** %arr_ptr290 to i8** + store i32 100, i32* %x_ptr283, align 8 + store i32 1, i32* %y_ptr284, align 4 + %270 = bitcast i64** %arr_ptr285 to i8** store i8* %4, i8** %270, align 8 - store i1* %.sub635, i1** %mask_ptr291, align 8 - call void @print_int_arr(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @res_is.F21393DB.0, i64 0, i64 0), i64 14, <{ i32, i32, i64*, i1* }>* nonnull %out_arr_alloca287) - br label %__barray_check_bounds.exit934 + store i1* %.sub629, i1** %mask_ptr286, align 8 + call void @print_int_arr(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @res_is.F21393DB.0, i64 0, i64 0), i64 14, <{ i32, i32, i64*, i1* }>* nonnull %out_arr_alloca282) + br label %__barray_check_bounds.exit928 -mask_block_err.i925: ; preds = %__barray_check_none_borrowed.exit921 +mask_block_err.i919: ; preds = %__barray_check_none_borrowed.exit915 call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable -__barray_check_bounds.exit934: ; preds = %cond_exit_130, %__barray_check_none_borrowed.exit926 - %"125_0.sroa.0.0974" = phi i64 [ 0, %__barray_check_none_borrowed.exit926 ], [ %271, %cond_exit_130 ] - %271 = add nuw nsw i64 %"125_0.sroa.0.0974", 1 - %272 = lshr i64 %"125_0.sroa.0.0974", 6 +__barray_check_bounds.exit928: ; preds = %cond_exit_130, %__barray_check_none_borrowed.exit920 + %"125_0.sroa.0.0968" = phi i64 [ 0, %__barray_check_none_borrowed.exit920 ], [ %271, %cond_exit_130 ] + %271 = add nuw nsw i64 %"125_0.sroa.0.0968", 1 + %272 = lshr i64 %"125_0.sroa.0.0968", 6 %273 = getelementptr inbounds i64, i64* %3, i64 %272 %274 = load i64, i64* %273, align 4 - %275 = and i64 %"125_0.sroa.0.0974", 63 + %275 = and i64 %"125_0.sroa.0.0968", 63 %276 = shl nuw i64 1, %275 %277 = and i64 %274, %276 - %.not.i935 = icmp eq i64 %277, 0 - br i1 %.not.i935, label %panic.i936, label %cond_exit_130 + %.not.i929 = icmp eq i64 %277, 0 + br i1 %.not.i929, label %panic.i930, label %cond_exit_130 -panic.i936: ; preds = %__barray_check_bounds.exit934 +panic.i930: ; preds = %__barray_check_bounds.exit928 call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -cond_exit_130: ; preds = %__barray_check_bounds.exit934 - %278 = sitofp i64 %"125_0.sroa.0.0974" to double +cond_exit_130: ; preds = %__barray_check_bounds.exit928 + %278 = sitofp i64 %"125_0.sroa.0.0968" to double %279 = fmul double %278, 6.250000e-02 %280 = xor i64 %274, %276 store i64 %280, i64* %273, align 4 - %281 = getelementptr inbounds double, double* %1, i64 %"125_0.sroa.0.0974" + %281 = getelementptr inbounds double, double* %1, i64 %"125_0.sroa.0.0968" store double %279, double* %281, align 8 - %exitcond985.not = icmp eq i64 %271, 100 - br i1 %exitcond985.not, label %loop_out299, label %__barray_check_bounds.exit934 + %exitcond979.not = icmp eq i64 %271, 100 + br i1 %exitcond979.not, label %loop_out294, label %__barray_check_bounds.exit928 -loop_out299: ; preds = %cond_exit_130 +loop_out294: ; preds = %cond_exit_130 %282 = getelementptr inbounds i8, i8* %2, i64 8 %283 = bitcast i8* %282 to i64* %284 = load i64, i64* %283, align 4 @@ -877,10 +877,10 @@ loop_out299: ; preds = %cond_exit_130 %286 = load i64, i64* %3, align 4 %287 = icmp eq i64 %286, 0 %288 = icmp eq i64 %285, 0 - %or.cond988 = select i1 %287, i1 %288, i1 false - br i1 %or.cond988, label %__barray_check_none_borrowed.exit942, label %mask_block_err.i941 + %or.cond982 = select i1 %287, i1 %288, i1 false + br i1 %or.cond982, label %__barray_check_none_borrowed.exit936, label %mask_block_err.i935 -__barray_check_none_borrowed.exit942: ; preds = %loop_out299 +__barray_check_none_borrowed.exit936: ; preds = %loop_out294 %289 = call i8* @heap_alloc(i64 800) %290 = bitcast i8* %289 to double* %291 = call i8* @heap_alloc(i64 16) @@ -894,32 +894,32 @@ __barray_check_none_borrowed.exit942: ; preds = %loop_out299 %295 = load i64, i64* %3, align 4 %296 = icmp eq i64 %295, 0 %297 = icmp eq i64 %294, 0 - %or.cond989 = select i1 %296, i1 %297, i1 false - br i1 %or.cond989, label %__barray_check_none_borrowed.exit947, label %mask_block_err.i946 + %or.cond983 = select i1 %296, i1 %297, i1 false + br i1 %or.cond983, label %__barray_check_none_borrowed.exit941, label %mask_block_err.i940 -mask_block_err.i941: ; preds = %loop_out299 +mask_block_err.i935: ; preds = %loop_out294 call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable -__barray_check_none_borrowed.exit947: ; preds = %__barray_check_none_borrowed.exit942 - %out_arr_alloca377 = alloca <{ i32, i32, double*, i1* }>, align 8 - %x_ptr378 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca377, i64 0, i32 0 - %y_ptr379 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca377, i64 0, i32 1 - %arr_ptr380 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca377, i64 0, i32 2 - %mask_ptr381 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca377, i64 0, i32 3 +__barray_check_none_borrowed.exit941: ; preds = %__barray_check_none_borrowed.exit936 + %out_arr_alloca371 = alloca <{ i32, i32, double*, i1* }>, align 8 + %x_ptr372 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca371, i64 0, i32 0 + %y_ptr373 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca371, i64 0, i32 1 + %arr_ptr374 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca371, i64 0, i32 2 + %mask_ptr375 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca371, i64 0, i32 3 %298 = alloca [100 x i1], align 1 - %.sub736 = getelementptr inbounds [100 x i1], [100 x i1]* %298, i64 0, i64 0 + %.sub730 = getelementptr inbounds [100 x i1], [100 x i1]* %298, i64 0, i64 0 %299 = bitcast [100 x i1]* %298 to i8* call void @llvm.memset.p0i8.i64(i8* noundef nonnull align 1 dereferenceable(100) %299, i8 0, i64 100, i1 false) - store i32 100, i32* %x_ptr378, align 8 - store i32 1, i32* %y_ptr379, align 4 - %300 = bitcast double** %arr_ptr380 to i8** + store i32 100, i32* %x_ptr372, align 8 + store i32 1, i32* %y_ptr373, align 4 + %300 = bitcast double** %arr_ptr374 to i8** store i8* %0, i8** %300, align 8 - store i1* %.sub736, i1** %mask_ptr381, align 8 - call void @print_float_arr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @res_fs.CBD4AF54.0, i64 0, i64 0), i64 16, <{ i32, i32, double*, i1* }>* nonnull %out_arr_alloca377) + store i1* %.sub730, i1** %mask_ptr375, align 8 + call void @print_float_arr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @res_fs.CBD4AF54.0, i64 0, i64 0), i64 16, <{ i32, i32, double*, i1* }>* nonnull %out_arr_alloca371) ret void -mask_block_err.i946: ; preds = %__barray_check_none_borrowed.exit942 +mask_block_err.i940: ; preds = %__barray_check_none_borrowed.exit936 call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin index f3c8c0092..aa1e328f5 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin @@ -38,8 +38,8 @@ entry: br label %cond_20_case_1.i cond_20_case_1.i: ; preds = %cond_exit_20.i, %entry - %"15_0.sroa.0.0295.i" = phi i64 [ 0, %entry ], [ %5, %cond_exit_20.i ] - %5 = add nuw nsw i64 %"15_0.sroa.0.0295.i", 1 + %"15_0.sroa.0.0294.i" = phi i64 [ 0, %entry ], [ %5, %cond_exit_20.i ] + %5 = add nuw nsw i64 %"15_0.sroa.0.0294.i", 1 %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.i.i = icmp eq i64 %qalloc.i.i, -1 br i1 %not_max.not.i.i, label %id_bb.i.i, label %reset_bb.i.i @@ -59,10 +59,10 @@ cond_217_case_0.i.i: ; preds = %id_bb.i.i unreachable __barray_check_bounds.exit.i: ; preds = %id_bb.i.i - %8 = lshr i64 %"15_0.sroa.0.0295.i", 6 + %8 = lshr i64 %"15_0.sroa.0.0294.i", 6 %9 = getelementptr inbounds i64, i64* %4, i64 %8 %10 = load i64, i64* %9, align 4 - %11 = shl nuw nsw i64 1, %"15_0.sroa.0.0295.i" + %11 = shl nuw nsw i64 1, %"15_0.sroa.0.0294.i" %12 = and i64 %10, %11 %.not.i.i = icmp eq i64 %12, 0 br i1 %.not.i.i, label %panic.i.i, label %cond_exit_20.i @@ -75,7 +75,7 @@ cond_exit_20.i: ; preds = %__barray_check_boun %.fca.1.extract.i.i = extractvalue { i1, i64 } %7, 1 %13 = xor i64 %10, %11 store i64 %13, i64* %9, align 4 - %14 = getelementptr inbounds i64, i64* %2, i64 %"15_0.sroa.0.0295.i" + %14 = getelementptr inbounds i64, i64* %2, i64 %"15_0.sroa.0.0294.i" store i64 %.fca.1.extract.i.i, i64* %14, align 4 %exitcond.not.i = icmp eq i64 %5, 10 br i1 %exitcond.not.i, label %loop_out.i, label %cond_20_case_1.i @@ -83,10 +83,10 @@ cond_exit_20.i: ; preds = %__barray_check_boun loop_out.i: ; preds = %cond_exit_20.i %15 = load i64, i64* %4, align 4 %16 = and i64 %15, 1 - %.not.i259.i = icmp eq i64 %16, 0 - br i1 %.not.i259.i, label %__barray_mask_borrow.exit.i, label %panic.i260.i + %.not.i258.i = icmp eq i64 %16, 0 + br i1 %.not.i258.i, label %__barray_mask_borrow.exit.i, label %panic.i259.i -panic.i260.i: ; preds = %loop_out.i +panic.i259.i: ; preds = %loop_out.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable @@ -97,27 +97,27 @@ __barray_mask_borrow.exit.i: ; preds = %loop_out.i tail call void @___rxy(i64 %18, double 0x400921FB54442D18, double 0.000000e+00) %19 = load i64, i64* %4, align 4 %20 = and i64 %19, 1 - %.not.i261.i = icmp eq i64 %20, 0 - br i1 %.not.i261.i, label %panic.i262.i, label %__barray_mask_return.exit263.i + %.not.i260.i = icmp eq i64 %20, 0 + br i1 %.not.i260.i, label %panic.i261.i, label %__barray_mask_return.exit262.i -panic.i262.i: ; preds = %__barray_mask_borrow.exit.i +panic.i261.i: ; preds = %__barray_mask_borrow.exit.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit263.i: ; preds = %__barray_mask_borrow.exit.i +__barray_mask_return.exit262.i: ; preds = %__barray_mask_borrow.exit.i %21 = xor i64 %19, 1 store i64 %21, i64* %4, align 4 store i64 %18, i64* %2, align 4 %22 = load i64, i64* %4, align 4 %23 = and i64 %22, 4 - %.not.i264.i = icmp eq i64 %23, 0 - br i1 %.not.i264.i, label %__barray_mask_borrow.exit266.i, label %panic.i265.i + %.not.i263.i = icmp eq i64 %23, 0 + br i1 %.not.i263.i, label %__barray_mask_borrow.exit265.i, label %panic.i264.i -panic.i265.i: ; preds = %__barray_mask_return.exit263.i +panic.i264.i: ; preds = %__barray_mask_return.exit262.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable -__barray_mask_borrow.exit266.i: ; preds = %__barray_mask_return.exit263.i +__barray_mask_borrow.exit265.i: ; preds = %__barray_mask_return.exit262.i %24 = xor i64 %22, 4 store i64 %24, i64* %4, align 4 %25 = getelementptr inbounds i8, i8* %1, i64 16 @@ -126,27 +126,27 @@ __barray_mask_borrow.exit266.i: ; preds = %__barray_mask_retur tail call void @___rxy(i64 %27, double 0x400921FB54442D18, double 0.000000e+00) %28 = load i64, i64* %4, align 4 %29 = and i64 %28, 4 - %.not.i267.i = icmp eq i64 %29, 0 - br i1 %.not.i267.i, label %panic.i268.i, label %__barray_mask_return.exit269.i + %.not.i266.i = icmp eq i64 %29, 0 + br i1 %.not.i266.i, label %panic.i267.i, label %__barray_mask_return.exit268.i -panic.i268.i: ; preds = %__barray_mask_borrow.exit266.i +panic.i267.i: ; preds = %__barray_mask_borrow.exit265.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit269.i: ; preds = %__barray_mask_borrow.exit266.i +__barray_mask_return.exit268.i: ; preds = %__barray_mask_borrow.exit265.i %30 = xor i64 %28, 4 store i64 %30, i64* %4, align 4 store i64 %27, i64* %26, align 4 %31 = load i64, i64* %4, align 4 %32 = and i64 %31, 8 - %.not.i270.i = icmp eq i64 %32, 0 - br i1 %.not.i270.i, label %__barray_mask_borrow.exit272.i, label %panic.i271.i + %.not.i269.i = icmp eq i64 %32, 0 + br i1 %.not.i269.i, label %__barray_mask_borrow.exit271.i, label %panic.i270.i -panic.i271.i: ; preds = %__barray_mask_return.exit269.i +panic.i270.i: ; preds = %__barray_mask_return.exit268.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable -__barray_mask_borrow.exit272.i: ; preds = %__barray_mask_return.exit269.i +__barray_mask_borrow.exit271.i: ; preds = %__barray_mask_return.exit268.i %33 = xor i64 %31, 8 store i64 %33, i64* %4, align 4 %34 = getelementptr inbounds i8, i8* %1, i64 24 @@ -155,27 +155,27 @@ __barray_mask_borrow.exit272.i: ; preds = %__barray_mask_retur tail call void @___rxy(i64 %36, double 0x400921FB54442D18, double 0.000000e+00) %37 = load i64, i64* %4, align 4 %38 = and i64 %37, 8 - %.not.i273.i = icmp eq i64 %38, 0 - br i1 %.not.i273.i, label %panic.i274.i, label %__barray_mask_return.exit275.i + %.not.i272.i = icmp eq i64 %38, 0 + br i1 %.not.i272.i, label %panic.i273.i, label %__barray_mask_return.exit274.i -panic.i274.i: ; preds = %__barray_mask_borrow.exit272.i +panic.i273.i: ; preds = %__barray_mask_borrow.exit271.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit275.i: ; preds = %__barray_mask_borrow.exit272.i +__barray_mask_return.exit274.i: ; preds = %__barray_mask_borrow.exit271.i %39 = xor i64 %37, 8 store i64 %39, i64* %4, align 4 store i64 %36, i64* %35, align 4 %40 = load i64, i64* %4, align 4 %41 = and i64 %40, 512 - %.not.i276.i = icmp eq i64 %41, 0 - br i1 %.not.i276.i, label %__barray_mask_borrow.exit278.i, label %panic.i277.i + %.not.i275.i = icmp eq i64 %41, 0 + br i1 %.not.i275.i, label %__barray_mask_borrow.exit277.i, label %panic.i276.i -panic.i277.i: ; preds = %__barray_mask_return.exit275.i +panic.i276.i: ; preds = %__barray_mask_return.exit274.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable -__barray_mask_borrow.exit278.i: ; preds = %__barray_mask_return.exit275.i +__barray_mask_borrow.exit277.i: ; preds = %__barray_mask_return.exit274.i %42 = xor i64 %40, 512 store i64 %42, i64* %4, align 4 %43 = getelementptr inbounds i8, i8* %1, i64 72 @@ -184,14 +184,14 @@ __barray_mask_borrow.exit278.i: ; preds = %__barray_mask_retur tail call void @___rxy(i64 %45, double 0x400921FB54442D18, double 0.000000e+00) %46 = load i64, i64* %4, align 4 %47 = and i64 %46, 512 - %.not.i279.i = icmp eq i64 %47, 0 - br i1 %.not.i279.i, label %panic.i280.i, label %__barray_mask_return.exit281.i + %.not.i278.i = icmp eq i64 %47, 0 + br i1 %.not.i278.i, label %panic.i279.i, label %__barray_mask_return.exit280.i -panic.i280.i: ; preds = %__barray_mask_borrow.exit278.i +panic.i279.i: ; preds = %__barray_mask_borrow.exit277.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit281.i: ; preds = %__barray_mask_borrow.exit278.i +__barray_mask_return.exit280.i: ; preds = %__barray_mask_borrow.exit277.i %48 = xor i64 %46, 512 store i64 %48, i64* %4, align 4 store i64 %45, i64* %44, align 4 @@ -212,19 +212,19 @@ mask_block_ok.i.i.i.i: ; preds = %cond_exit_353.i.i "__hugr__.$measure_array$$n(10).277.exit.i": ; preds = %mask_block_ok.i.i.i.i tail call void @heap_free(i8* nonnull %1) tail call void @heap_free(i8* nonnull %3) - br label %__barray_check_bounds.exit284.i + br label %__barray_check_bounds.exit283.i mask_block_err.i.i.i.i: ; preds = %mask_block_ok.i.i.i.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @"e_Array cont.EFA5AC45.0", i64 0, i64 0)) unreachable -56: ; preds = %cond_exit_353.i.i, %__barray_mask_return.exit281.i - %"303_0.sroa.15.0.i297.i" = phi i64 [ 0, %__barray_mask_return.exit281.i ], [ %57, %cond_exit_353.i.i ] - %57 = add nuw nsw i64 %"303_0.sroa.15.0.i297.i", 1 - %58 = lshr i64 %"303_0.sroa.15.0.i297.i", 6 +56: ; preds = %cond_exit_353.i.i, %__barray_mask_return.exit280.i + %"303_0.sroa.15.0.i296.i" = phi i64 [ 0, %__barray_mask_return.exit280.i ], [ %57, %cond_exit_353.i.i ] + %57 = add nuw nsw i64 %"303_0.sroa.15.0.i296.i", 1 + %58 = lshr i64 %"303_0.sroa.15.0.i296.i", 6 %59 = getelementptr inbounds i64, i64* %4, i64 %58 %60 = load i64, i64* %59, align 4 - %61 = shl nuw nsw i64 1, %"303_0.sroa.15.0.i297.i" + %61 = shl nuw nsw i64 1, %"303_0.sroa.15.0.i296.i" %62 = and i64 %60, %61 %.not.i99.i.i.i = icmp eq i64 %62, 0 br i1 %.not.i99.i.i.i, label %__barray_check_bounds.exit.i.i, label %panic.i.i.i.i @@ -236,7 +236,7 @@ panic.i.i.i.i: ; preds = %56 __barray_check_bounds.exit.i.i: ; preds = %56 %63 = xor i64 %60, %61 store i64 %63, i64* %59, align 4 - %64 = getelementptr inbounds i64, i64* %2, i64 %"303_0.sroa.15.0.i297.i" + %64 = getelementptr inbounds i64, i64* %2, i64 %"303_0.sroa.15.0.i296.i" %65 = load i64, i64* %64, align 4 %lazy_measure.i.i = tail call i64 @___lazy_measure(i64 %65) tail call void @___qfree(i64 %65) @@ -254,51 +254,51 @@ cond_exit_353.i.i: ; preds = %__barray_check_boun %"367_054.fca.1.insert.i.i" = insertvalue { i1, i64, i1 } { i1 true, i64 poison, i1 poison }, i64 %lazy_measure.i.i, 1 %69 = xor i64 %67, %61 store i64 %69, i64* %66, align 4 - %70 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %50, i64 %"303_0.sroa.15.0.i297.i" + %70 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %50, i64 %"303_0.sroa.15.0.i296.i" store { i1, i64, i1 } %"367_054.fca.1.insert.i.i", { i1, i64, i1 }* %70, align 4 - %exitcond298.not.i = icmp eq i64 %57, 10 - br i1 %exitcond298.not.i, label %mask_block_ok.i.i.i.i, label %56 + %exitcond297.not.i = icmp eq i64 %57, 10 + br i1 %exitcond297.not.i, label %mask_block_ok.i.i.i.i, label %56 -cond_160_case_0.i: ; preds = %cond_exit_160.i +cond_187_case_0.i: ; preds = %cond_exit_187.i %71 = load i64, i64* %52, align 4 %72 = or i64 %71, -1024 store i64 %72, i64* %52, align 4 %73 = icmp eq i64 %72, -1 br i1 %73, label %__hugr__.main.1.exit, label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_160_case_0.i +mask_block_err.i.i: ; preds = %cond_187_case_0.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @"e_Array cont.EFA5AC45.0", i64 0, i64 0)) unreachable -__barray_check_bounds.exit284.i: ; preds = %"__hugr__.$measure_array$$n(10).277.exit.i", %cond_exit_160.i - %"162_0.0.i1" = phi i64 [ 0, %"__hugr__.$measure_array$$n(10).277.exit.i" ], [ %82, %cond_exit_160.i ] - %74 = lshr i64 %"162_0.0.i1", 6 +__barray_check_bounds.exit283.i: ; preds = %"__hugr__.$measure_array$$n(10).277.exit.i", %cond_exit_187.i + %"164_0.0.i1" = phi i64 [ 0, %"__hugr__.$measure_array$$n(10).277.exit.i" ], [ %82, %cond_exit_187.i ] + %74 = lshr i64 %"164_0.0.i1", 6 %75 = getelementptr inbounds i64, i64* %52, i64 %74 %76 = load i64, i64* %75, align 4 - %77 = shl nuw nsw i64 1, %"162_0.0.i1" + %77 = shl nuw nsw i64 1, %"164_0.0.i1" %78 = and i64 %76, %77 %.not.i = icmp eq i64 %78, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit289.i, label %cond_exit_160.i + br i1 %.not.i, label %__barray_mask_borrow.exit288.i, label %cond_exit_187.i -__barray_mask_borrow.exit289.i: ; preds = %__barray_check_bounds.exit284.i +__barray_mask_borrow.exit288.i: ; preds = %__barray_check_bounds.exit283.i %79 = xor i64 %76, %77 store i64 %79, i64* %75, align 4 - %80 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %50, i64 %"162_0.0.i1" + %80 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %50, i64 %"164_0.0.i1" %81 = load { i1, i64, i1 }, { i1, i64, i1 }* %80, align 4 - %.fca.0.extract180.i = extractvalue { i1, i64, i1 } %81, 0 - br i1 %.fca.0.extract180.i, label %cond_85_case_1.i, label %cond_exit_160.i + %.fca.0.extract179.i = extractvalue { i1, i64, i1 } %81, 0 + br i1 %.fca.0.extract179.i, label %cond_87_case_1.i, label %cond_exit_187.i -cond_exit_160.i: ; preds = %cond_85_case_1.i, %__barray_mask_borrow.exit289.i, %__barray_check_bounds.exit284.i - %82 = add nuw nsw i64 %"162_0.0.i1", 1 +cond_exit_187.i: ; preds = %cond_87_case_1.i, %__barray_mask_borrow.exit288.i, %__barray_check_bounds.exit283.i + %82 = add nuw nsw i64 %"164_0.0.i1", 1 %exitcond.not = icmp eq i64 %82, 10 - br i1 %exitcond.not, label %cond_160_case_0.i, label %__barray_check_bounds.exit284.i + br i1 %exitcond.not, label %cond_187_case_0.i, label %__barray_check_bounds.exit283.i -cond_85_case_1.i: ; preds = %__barray_mask_borrow.exit289.i +cond_87_case_1.i: ; preds = %__barray_mask_borrow.exit288.i %.fca.1.extract.i = extractvalue { i1, i64, i1 } %81, 1 tail call void @___dec_future_refcount(i64 %.fca.1.extract.i) - br label %cond_exit_160.i + br label %cond_exit_187.i -__hugr__.main.1.exit: ; preds = %cond_160_case_0.i +__hugr__.main.1.exit: ; preds = %cond_187_case_0.i tail call void @heap_free(i8* %49) tail call void @heap_free(i8* nonnull %51) %83 = tail call i64 @teardown() diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/x86_64-apple-darwin-print_array/print_array_x86_64-apple-darwin b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/x86_64-apple-darwin-print_array/print_array_x86_64-apple-darwin index 4c5d75106..7e5273479 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/x86_64-apple-darwin-print_array/print_array_x86_64-apple-darwin +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/x86_64-apple-darwin-print_array/print_array_x86_64-apple-darwin @@ -34,8 +34,8 @@ alloca_block: br label %cond_20_case_1 cond_20_case_1: ; preds = %alloca_block, %cond_exit_20 - %"15_0.sroa.0.0961" = phi i64 [ 0, %alloca_block ], [ %12, %cond_exit_20 ] - %12 = add nuw nsw i64 %"15_0.sroa.0.0961", 1 + %"15_0.sroa.0.0955" = phi i64 [ 0, %alloca_block ], [ %12, %cond_exit_20 ] + %12 = add nuw nsw i64 %"15_0.sroa.0.0955", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.i = icmp eq i64 %qalloc.i, -1 br i1 %not_max.not.i, label %id_bb.i, label %reset_bb.i @@ -55,10 +55,10 @@ cond_303_case_0.i: ; preds = %id_bb.i unreachable __barray_check_bounds.exit: ; preds = %id_bb.i - %15 = lshr i64 %"15_0.sroa.0.0961", 6 + %15 = lshr i64 %"15_0.sroa.0.0955", 6 %16 = getelementptr inbounds i64, i64* %11, i64 %15 %17 = load i64, i64* %16, align 4 - %18 = shl nuw nsw i64 1, %"15_0.sroa.0.0961" + %18 = shl nuw nsw i64 1, %"15_0.sroa.0.0955" %19 = and i64 %17, %18 %.not.i = icmp eq i64 %19, 0 br i1 %.not.i, label %panic.i, label %cond_exit_20 @@ -71,7 +71,7 @@ cond_exit_20: ; preds = %__barray_check_boun %.fca.1.extract.i = extractvalue { i1, i64 } %14, 1 %20 = xor i64 %17, %18 store i64 %20, i64* %16, align 4 - %21 = getelementptr inbounds i64, i64* %9, i64 %"15_0.sroa.0.0961" + %21 = getelementptr inbounds i64, i64* %9, i64 %"15_0.sroa.0.0955" store i64 %.fca.1.extract.i, i64* %21, align 4 %exitcond.not = icmp eq i64 %12, 10 br i1 %exitcond.not, label %loop_out, label %cond_20_case_1 @@ -79,10 +79,10 @@ cond_exit_20: ; preds = %__barray_check_boun loop_out: ; preds = %cond_exit_20 %22 = load i64, i64* %11, align 4 %23 = and i64 %22, 1 - %.not.i852 = icmp eq i64 %23, 0 - br i1 %.not.i852, label %__barray_mask_borrow.exit, label %panic.i853 + %.not.i846 = icmp eq i64 %23, 0 + br i1 %.not.i846, label %__barray_mask_borrow.exit, label %panic.i847 -panic.i853: ; preds = %loop_out +panic.i847: ; preds = %loop_out tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable @@ -93,27 +93,27 @@ __barray_mask_borrow.exit: ; preds = %loop_out tail call void @___rxy(i64 %25, double 0x400921FB54442D18, double 0.000000e+00) %26 = load i64, i64* %11, align 4 %27 = and i64 %26, 1 - %.not.i854 = icmp eq i64 %27, 0 - br i1 %.not.i854, label %panic.i855, label %__barray_mask_return.exit856 + %.not.i848 = icmp eq i64 %27, 0 + br i1 %.not.i848, label %panic.i849, label %__barray_mask_return.exit850 -panic.i855: ; preds = %__barray_mask_borrow.exit +panic.i849: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit856: ; preds = %__barray_mask_borrow.exit +__barray_mask_return.exit850: ; preds = %__barray_mask_borrow.exit %28 = xor i64 %26, 1 store i64 %28, i64* %11, align 4 store i64 %25, i64* %9, align 4 %29 = load i64, i64* %11, align 4 %30 = and i64 %29, 4 - %.not.i857 = icmp eq i64 %30, 0 - br i1 %.not.i857, label %__barray_mask_borrow.exit859, label %panic.i858 + %.not.i851 = icmp eq i64 %30, 0 + br i1 %.not.i851, label %__barray_mask_borrow.exit853, label %panic.i852 -panic.i858: ; preds = %__barray_mask_return.exit856 +panic.i852: ; preds = %__barray_mask_return.exit850 tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable -__barray_mask_borrow.exit859: ; preds = %__barray_mask_return.exit856 +__barray_mask_borrow.exit853: ; preds = %__barray_mask_return.exit850 %31 = xor i64 %29, 4 store i64 %31, i64* %11, align 4 %32 = getelementptr inbounds i8, i8* %8, i64 16 @@ -122,27 +122,27 @@ __barray_mask_borrow.exit859: ; preds = %__barray_mask_retur tail call void @___rxy(i64 %34, double 0x400921FB54442D18, double 0.000000e+00) %35 = load i64, i64* %11, align 4 %36 = and i64 %35, 4 - %.not.i860 = icmp eq i64 %36, 0 - br i1 %.not.i860, label %panic.i861, label %__barray_mask_return.exit862 + %.not.i854 = icmp eq i64 %36, 0 + br i1 %.not.i854, label %panic.i855, label %__barray_mask_return.exit856 -panic.i861: ; preds = %__barray_mask_borrow.exit859 +panic.i855: ; preds = %__barray_mask_borrow.exit853 tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit862: ; preds = %__barray_mask_borrow.exit859 +__barray_mask_return.exit856: ; preds = %__barray_mask_borrow.exit853 %37 = xor i64 %35, 4 store i64 %37, i64* %11, align 4 store i64 %34, i64* %33, align 4 %38 = load i64, i64* %11, align 4 %39 = and i64 %38, 8 - %.not.i863 = icmp eq i64 %39, 0 - br i1 %.not.i863, label %__barray_mask_borrow.exit865, label %panic.i864 + %.not.i857 = icmp eq i64 %39, 0 + br i1 %.not.i857, label %__barray_mask_borrow.exit859, label %panic.i858 -panic.i864: ; preds = %__barray_mask_return.exit862 +panic.i858: ; preds = %__barray_mask_return.exit856 tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable -__barray_mask_borrow.exit865: ; preds = %__barray_mask_return.exit862 +__barray_mask_borrow.exit859: ; preds = %__barray_mask_return.exit856 %40 = xor i64 %38, 8 store i64 %40, i64* %11, align 4 %41 = getelementptr inbounds i8, i8* %8, i64 24 @@ -151,27 +151,27 @@ __barray_mask_borrow.exit865: ; preds = %__barray_mask_retur tail call void @___rxy(i64 %43, double 0x400921FB54442D18, double 0.000000e+00) %44 = load i64, i64* %11, align 4 %45 = and i64 %44, 8 - %.not.i866 = icmp eq i64 %45, 0 - br i1 %.not.i866, label %panic.i867, label %__barray_mask_return.exit868 + %.not.i860 = icmp eq i64 %45, 0 + br i1 %.not.i860, label %panic.i861, label %__barray_mask_return.exit862 -panic.i867: ; preds = %__barray_mask_borrow.exit865 +panic.i861: ; preds = %__barray_mask_borrow.exit859 tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit868: ; preds = %__barray_mask_borrow.exit865 +__barray_mask_return.exit862: ; preds = %__barray_mask_borrow.exit859 %46 = xor i64 %44, 8 store i64 %46, i64* %11, align 4 store i64 %43, i64* %42, align 4 %47 = load i64, i64* %11, align 4 %48 = and i64 %47, 512 - %.not.i869 = icmp eq i64 %48, 0 - br i1 %.not.i869, label %__barray_mask_borrow.exit871, label %panic.i870 + %.not.i863 = icmp eq i64 %48, 0 + br i1 %.not.i863, label %__barray_mask_borrow.exit865, label %panic.i864 -panic.i870: ; preds = %__barray_mask_return.exit868 +panic.i864: ; preds = %__barray_mask_return.exit862 tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable -__barray_mask_borrow.exit871: ; preds = %__barray_mask_return.exit868 +__barray_mask_borrow.exit865: ; preds = %__barray_mask_return.exit862 %49 = xor i64 %47, 512 store i64 %49, i64* %11, align 4 %50 = getelementptr inbounds i8, i8* %8, i64 72 @@ -180,14 +180,14 @@ __barray_mask_borrow.exit871: ; preds = %__barray_mask_retur tail call void @___rxy(i64 %52, double 0x400921FB54442D18, double 0.000000e+00) %53 = load i64, i64* %11, align 4 %54 = and i64 %53, 512 - %.not.i872 = icmp eq i64 %54, 0 - br i1 %.not.i872, label %panic.i873, label %__barray_mask_return.exit874 + %.not.i866 = icmp eq i64 %54, 0 + br i1 %.not.i866, label %panic.i867, label %__barray_mask_return.exit868 -panic.i873: ; preds = %__barray_mask_borrow.exit871 +panic.i867: ; preds = %__barray_mask_borrow.exit865 tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit874: ; preds = %__barray_mask_borrow.exit871 +__barray_mask_return.exit868: ; preds = %__barray_mask_borrow.exit865 %55 = xor i64 %53, 512 store i64 %55, i64* %11, align 4 store i64 %52, i64* %51, align 4 @@ -223,13 +223,13 @@ mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @"e_Array cont.EFA5AC45.0", i64 0, i64 0)) unreachable -69: ; preds = %__barray_mask_return.exit874, %cond_exit_443.i - %"393_0.sroa.15.0.i963" = phi i64 [ 0, %__barray_mask_return.exit874 ], [ %70, %cond_exit_443.i ] - %70 = add nuw nsw i64 %"393_0.sroa.15.0.i963", 1 - %71 = lshr i64 %"393_0.sroa.15.0.i963", 6 +69: ; preds = %__barray_mask_return.exit868, %cond_exit_443.i + %"393_0.sroa.15.0.i957" = phi i64 [ 0, %__barray_mask_return.exit868 ], [ %70, %cond_exit_443.i ] + %70 = add nuw nsw i64 %"393_0.sroa.15.0.i957", 1 + %71 = lshr i64 %"393_0.sroa.15.0.i957", 6 %72 = getelementptr inbounds i64, i64* %11, i64 %71 %73 = load i64, i64* %72, align 4 - %74 = shl nuw nsw i64 1, %"393_0.sroa.15.0.i963" + %74 = shl nuw nsw i64 1, %"393_0.sroa.15.0.i957" %75 = and i64 %73, %74 %.not.i99.i.i = icmp eq i64 %75, 0 br i1 %.not.i99.i.i, label %__barray_check_bounds.exit.i, label %panic.i.i.i @@ -241,7 +241,7 @@ panic.i.i.i: ; preds = %69 __barray_check_bounds.exit.i: ; preds = %69 %76 = xor i64 %73, %74 store i64 %76, i64* %72, align 4 - %77 = getelementptr inbounds i64, i64* %9, i64 %"393_0.sroa.15.0.i963" + %77 = getelementptr inbounds i64, i64* %9, i64 %"393_0.sroa.15.0.i957" %78 = load i64, i64* %77, align 4 %lazy_measure.i = tail call i64 @___lazy_measure(i64 %78) tail call void @___qfree(i64 %78) @@ -259,10 +259,10 @@ cond_exit_443.i: ; preds = %__barray_check_boun %"457_054.fca.1.insert.i" = insertvalue { i1, i64, i1 } { i1 true, i64 poison, i1 poison }, i64 %lazy_measure.i, 1 %82 = xor i64 %80, %74 store i64 %82, i64* %79, align 4 - %83 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %57, i64 %"393_0.sroa.15.0.i963" + %83 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %57, i64 %"393_0.sroa.15.0.i957" store { i1, i64, i1 } %"457_054.fca.1.insert.i", { i1, i64, i1 }* %83, align 4 - %exitcond979.not = icmp eq i64 %70, 10 - br i1 %exitcond979.not, label %mask_block_ok.i.i.i, label %69 + %exitcond973.not = icmp eq i64 %70, 10 + br i1 %exitcond973.not, label %mask_block_ok.i.i.i, label %69 __barray_check_none_borrowed.exit: ; preds = %"__hugr__.$measure_array$$n(10).367.exit" %84 = tail call i8* @heap_alloc(i64 240) @@ -277,78 +277,78 @@ mask_block_err.i: ; preds = %"__hugr__.$measure_ tail call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable -89: ; preds = %__barray_check_none_borrowed.exit, %__hugr__.const_fun_290.309.exit - %storemerge850968 = phi i64 [ 0, %__barray_check_none_borrowed.exit ], [ %107, %__hugr__.const_fun_290.309.exit ] - %90 = phi i64 [ 0, %__barray_check_none_borrowed.exit ], [ %105, %__hugr__.const_fun_290.309.exit ] - %91 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %57, i64 %storemerge850968 +89: ; preds = %__barray_check_none_borrowed.exit, %__hugr__.const_fun_338.322.exit + %storemerge844962 = phi i64 [ 0, %__barray_check_none_borrowed.exit ], [ %107, %__hugr__.const_fun_338.322.exit ] + %90 = phi i64 [ 0, %__barray_check_none_borrowed.exit ], [ %105, %__hugr__.const_fun_338.322.exit ] + %91 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %57, i64 %storemerge844962 %92 = load { i1, i64, i1 }, { i1, i64, i1 }* %91, align 4 %.fca.0.extract118.i = extractvalue { i1, i64, i1 } %92, 0 %.fca.1.extract119.i = extractvalue { i1, i64, i1 } %92, 1 - br i1 %.fca.0.extract118.i, label %cond_525_case_1.i, label %cond_exit_525.i + br i1 %.fca.0.extract118.i, label %cond_513_case_1.i, label %cond_exit_513.i -cond_525_case_1.i: ; preds = %89 +cond_513_case_1.i: ; preds = %89 tail call void @___inc_future_refcount(i64 %.fca.1.extract119.i) %93 = insertvalue { i1, i64, i1 } { i1 true, i64 poison, i1 poison }, i64 %.fca.1.extract119.i, 1 - br label %cond_exit_525.i + br label %cond_exit_513.i -cond_exit_525.i: ; preds = %cond_525_case_1.i, %89 - %.pn.i = phi { i1, i64, i1 } [ %93, %cond_525_case_1.i ], [ %92, %89 ] +cond_exit_513.i: ; preds = %cond_513_case_1.i, %89 + %.pn.i = phi { i1, i64, i1 } [ %93, %cond_513_case_1.i ], [ %92, %89 ] %"04.sroa.6.0.i" = extractvalue { i1, i64, i1 } %.pn.i, 2 %94 = icmp ult i64 %90, 10 - br i1 %94, label %95, label %cond_528_case_0.i + br i1 %94, label %95, label %cond_516_case_0.i -95: ; preds = %cond_exit_525.i +95: ; preds = %cond_exit_513.i %96 = lshr i64 %90, 6 %97 = getelementptr inbounds i64, i64* %65, i64 %96 %98 = load i64, i64* %97, align 4 %99 = shl nuw nsw i64 1, %90 %100 = and i64 %98, %99 - %.not.i.i876 = icmp eq i64 %100, 0 - br i1 %.not.i.i876, label %cond_528_case_1.i, label %panic.i.i877 + %.not.i.i870 = icmp eq i64 %100, 0 + br i1 %.not.i.i870, label %cond_516_case_1.i, label %panic.i.i871 -panic.i.i877: ; preds = %95 +panic.i.i871: ; preds = %95 tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable -cond_528_case_0.i: ; preds = %cond_exit_525.i +cond_516_case_0.i: ; preds = %cond_exit_513.i tail call void @panic(i32 1001, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @"e_Expected v.E6312129.0", i64 0, i64 0)) unreachable -cond_528_case_1.i: ; preds = %95 +cond_516_case_1.i: ; preds = %95 %"17.fca.2.insert.i" = insertvalue { i1, i64, i1 } %92, i1 %"04.sroa.6.0.i", 2 %101 = insertvalue { i1, { i1, i64, i1 } } { i1 true, { i1, i64, i1 } poison }, { i1, i64, i1 } %"17.fca.2.insert.i", 1 %102 = getelementptr inbounds { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %88, i64 %90 %103 = getelementptr inbounds { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %102, i64 0, i32 0 %104 = load i1, i1* %103, align 1 store { i1, { i1, i64, i1 } } %101, { i1, { i1, i64, i1 } }* %102, align 4 - br i1 %104, label %cond_529_case_1.i, label %__hugr__.const_fun_290.309.exit + br i1 %104, label %cond_517_case_1.i, label %__hugr__.const_fun_338.322.exit -cond_529_case_1.i: ; preds = %cond_528_case_1.i +cond_517_case_1.i: ; preds = %cond_516_case_1.i tail call void @panic(i32 1001, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @"e_Expected v.2F17E0A9.0", i64 0, i64 0)) unreachable -__hugr__.const_fun_290.309.exit: ; preds = %cond_528_case_1.i +__hugr__.const_fun_338.322.exit: ; preds = %cond_516_case_1.i %105 = add nuw nsw i64 %90, 1 - %106 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %85, i64 %storemerge850968 + %106 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %85, i64 %storemerge844962 store { i1, i64, i1 } %"17.fca.2.insert.i", { i1, i64, i1 }* %106, align 4 - %107 = add nuw nsw i64 %storemerge850968, 1 - %exitcond980.not = icmp eq i64 %107, 10 - br i1 %exitcond980.not, label %mask_block_ok.i881, label %89 + %107 = add nuw nsw i64 %storemerge844962, 1 + %exitcond974.not = icmp eq i64 %107, 10 + br i1 %exitcond974.not, label %mask_block_ok.i875, label %89 -mask_block_ok.i881: ; preds = %__hugr__.const_fun_290.309.exit +mask_block_ok.i875: ; preds = %__hugr__.const_fun_338.322.exit tail call void @heap_free(i8* nonnull %56) tail call void @heap_free(i8* %58) %108 = load i64, i64* %65, align 4 %109 = and i64 %108, 1023 store i64 %109, i64* %65, align 4 %110 = icmp eq i64 %109, 0 - br i1 %110, label %__barray_check_none_borrowed.exit883, label %mask_block_err.i882 + br i1 %110, label %__barray_check_none_borrowed.exit877, label %mask_block_err.i876 -mask_block_err.i882: ; preds = %mask_block_ok.i881 +mask_block_err.i876: ; preds = %mask_block_ok.i875 tail call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable -__barray_check_none_borrowed.exit883: ; preds = %mask_block_ok.i881 +__barray_check_none_borrowed.exit877: ; preds = %mask_block_ok.i875 %111 = tail call i8* @heap_alloc(i64 240) %112 = bitcast i8* %111 to { i1, i64, i1 }* %113 = tail call i8* @heap_alloc(i64 8) @@ -356,22 +356,22 @@ __barray_check_none_borrowed.exit883: ; preds = %mask_block_ok.i881 store i64 0, i64* %114, align 1 %115 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %88, align 4 %.fca.0.extract11.i = extractvalue { i1, { i1, i64, i1 } } %115, 0 - br i1 %.fca.0.extract11.i, label %__hugr__.const_fun_284.290.exit, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i, label %__hugr__.const_fun_287.338.exit, label %cond_558_case_0.i -cond_570_case_0.i: ; preds = %__hugr__.const_fun_284.290.exit.8, %__hugr__.const_fun_284.290.exit.7, %__hugr__.const_fun_284.290.exit.6, %__hugr__.const_fun_284.290.exit.5, %__hugr__.const_fun_284.290.exit.4, %__hugr__.const_fun_284.290.exit.3, %__hugr__.const_fun_284.290.exit.2, %__hugr__.const_fun_284.290.exit.1, %__hugr__.const_fun_284.290.exit, %__barray_check_none_borrowed.exit883 +cond_558_case_0.i: ; preds = %__hugr__.const_fun_287.338.exit.8, %__hugr__.const_fun_287.338.exit.7, %__hugr__.const_fun_287.338.exit.6, %__hugr__.const_fun_287.338.exit.5, %__hugr__.const_fun_287.338.exit.4, %__hugr__.const_fun_287.338.exit.3, %__hugr__.const_fun_287.338.exit.2, %__hugr__.const_fun_287.338.exit.1, %__hugr__.const_fun_287.338.exit, %__barray_check_none_borrowed.exit877 tail call void @panic(i32 1001, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @"e_Expected v.E6312129.0", i64 0, i64 0)) unreachable -__hugr__.const_fun_284.290.exit: ; preds = %__barray_check_none_borrowed.exit883 +__hugr__.const_fun_287.338.exit: ; preds = %__barray_check_none_borrowed.exit877 %116 = extractvalue { i1, { i1, i64, i1 } } %115, 1 store { i1, i64, i1 } %116, { i1, i64, i1 }* %112, align 4 %117 = getelementptr inbounds i8, i8* %63, i64 32 %118 = bitcast i8* %117 to { i1, { i1, i64, i1 } }* %119 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %118, align 4 %.fca.0.extract11.i.1 = extractvalue { i1, { i1, i64, i1 } } %119, 0 - br i1 %.fca.0.extract11.i.1, label %__hugr__.const_fun_284.290.exit.1, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.1, label %__hugr__.const_fun_287.338.exit.1, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.1: ; preds = %__hugr__.const_fun_284.290.exit +__hugr__.const_fun_287.338.exit.1: ; preds = %__hugr__.const_fun_287.338.exit %120 = extractvalue { i1, { i1, i64, i1 } } %119, 1 %121 = getelementptr inbounds i8, i8* %111, i64 24 %122 = bitcast i8* %121 to { i1, i64, i1 }* @@ -380,9 +380,9 @@ __hugr__.const_fun_284.290.exit.1: ; preds = %__hugr__.const_fun_ %124 = bitcast i8* %123 to { i1, { i1, i64, i1 } }* %125 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %124, align 4 %.fca.0.extract11.i.2 = extractvalue { i1, { i1, i64, i1 } } %125, 0 - br i1 %.fca.0.extract11.i.2, label %__hugr__.const_fun_284.290.exit.2, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.2, label %__hugr__.const_fun_287.338.exit.2, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.2: ; preds = %__hugr__.const_fun_284.290.exit.1 +__hugr__.const_fun_287.338.exit.2: ; preds = %__hugr__.const_fun_287.338.exit.1 %126 = extractvalue { i1, { i1, i64, i1 } } %125, 1 %127 = getelementptr inbounds i8, i8* %111, i64 48 %128 = bitcast i8* %127 to { i1, i64, i1 }* @@ -391,9 +391,9 @@ __hugr__.const_fun_284.290.exit.2: ; preds = %__hugr__.const_fun_ %130 = bitcast i8* %129 to { i1, { i1, i64, i1 } }* %131 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %130, align 4 %.fca.0.extract11.i.3 = extractvalue { i1, { i1, i64, i1 } } %131, 0 - br i1 %.fca.0.extract11.i.3, label %__hugr__.const_fun_284.290.exit.3, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.3, label %__hugr__.const_fun_287.338.exit.3, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.3: ; preds = %__hugr__.const_fun_284.290.exit.2 +__hugr__.const_fun_287.338.exit.3: ; preds = %__hugr__.const_fun_287.338.exit.2 %132 = extractvalue { i1, { i1, i64, i1 } } %131, 1 %133 = getelementptr inbounds i8, i8* %111, i64 72 %134 = bitcast i8* %133 to { i1, i64, i1 }* @@ -402,9 +402,9 @@ __hugr__.const_fun_284.290.exit.3: ; preds = %__hugr__.const_fun_ %136 = bitcast i8* %135 to { i1, { i1, i64, i1 } }* %137 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %136, align 4 %.fca.0.extract11.i.4 = extractvalue { i1, { i1, i64, i1 } } %137, 0 - br i1 %.fca.0.extract11.i.4, label %__hugr__.const_fun_284.290.exit.4, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.4, label %__hugr__.const_fun_287.338.exit.4, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.4: ; preds = %__hugr__.const_fun_284.290.exit.3 +__hugr__.const_fun_287.338.exit.4: ; preds = %__hugr__.const_fun_287.338.exit.3 %138 = extractvalue { i1, { i1, i64, i1 } } %137, 1 %139 = getelementptr inbounds i8, i8* %111, i64 96 %140 = bitcast i8* %139 to { i1, i64, i1 }* @@ -413,9 +413,9 @@ __hugr__.const_fun_284.290.exit.4: ; preds = %__hugr__.const_fun_ %142 = bitcast i8* %141 to { i1, { i1, i64, i1 } }* %143 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %142, align 4 %.fca.0.extract11.i.5 = extractvalue { i1, { i1, i64, i1 } } %143, 0 - br i1 %.fca.0.extract11.i.5, label %__hugr__.const_fun_284.290.exit.5, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.5, label %__hugr__.const_fun_287.338.exit.5, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.5: ; preds = %__hugr__.const_fun_284.290.exit.4 +__hugr__.const_fun_287.338.exit.5: ; preds = %__hugr__.const_fun_287.338.exit.4 %144 = extractvalue { i1, { i1, i64, i1 } } %143, 1 %145 = getelementptr inbounds i8, i8* %111, i64 120 %146 = bitcast i8* %145 to { i1, i64, i1 }* @@ -424,9 +424,9 @@ __hugr__.const_fun_284.290.exit.5: ; preds = %__hugr__.const_fun_ %148 = bitcast i8* %147 to { i1, { i1, i64, i1 } }* %149 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %148, align 4 %.fca.0.extract11.i.6 = extractvalue { i1, { i1, i64, i1 } } %149, 0 - br i1 %.fca.0.extract11.i.6, label %__hugr__.const_fun_284.290.exit.6, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.6, label %__hugr__.const_fun_287.338.exit.6, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.6: ; preds = %__hugr__.const_fun_284.290.exit.5 +__hugr__.const_fun_287.338.exit.6: ; preds = %__hugr__.const_fun_287.338.exit.5 %150 = extractvalue { i1, { i1, i64, i1 } } %149, 1 %151 = getelementptr inbounds i8, i8* %111, i64 144 %152 = bitcast i8* %151 to { i1, i64, i1 }* @@ -435,9 +435,9 @@ __hugr__.const_fun_284.290.exit.6: ; preds = %__hugr__.const_fun_ %154 = bitcast i8* %153 to { i1, { i1, i64, i1 } }* %155 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %154, align 4 %.fca.0.extract11.i.7 = extractvalue { i1, { i1, i64, i1 } } %155, 0 - br i1 %.fca.0.extract11.i.7, label %__hugr__.const_fun_284.290.exit.7, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.7, label %__hugr__.const_fun_287.338.exit.7, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.7: ; preds = %__hugr__.const_fun_284.290.exit.6 +__hugr__.const_fun_287.338.exit.7: ; preds = %__hugr__.const_fun_287.338.exit.6 %156 = extractvalue { i1, { i1, i64, i1 } } %155, 1 %157 = getelementptr inbounds i8, i8* %111, i64 168 %158 = bitcast i8* %157 to { i1, i64, i1 }* @@ -446,9 +446,9 @@ __hugr__.const_fun_284.290.exit.7: ; preds = %__hugr__.const_fun_ %160 = bitcast i8* %159 to { i1, { i1, i64, i1 } }* %161 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %160, align 4 %.fca.0.extract11.i.8 = extractvalue { i1, { i1, i64, i1 } } %161, 0 - br i1 %.fca.0.extract11.i.8, label %__hugr__.const_fun_284.290.exit.8, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.8, label %__hugr__.const_fun_287.338.exit.8, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.8: ; preds = %__hugr__.const_fun_284.290.exit.7 +__hugr__.const_fun_287.338.exit.8: ; preds = %__hugr__.const_fun_287.338.exit.7 %162 = extractvalue { i1, { i1, i64, i1 } } %161, 1 %163 = getelementptr inbounds i8, i8* %111, i64 192 %164 = bitcast i8* %163 to { i1, i64, i1 }* @@ -457,86 +457,86 @@ __hugr__.const_fun_284.290.exit.8: ; preds = %__hugr__.const_fun_ %166 = bitcast i8* %165 to { i1, { i1, i64, i1 } }* %167 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %166, align 4 %.fca.0.extract11.i.9 = extractvalue { i1, { i1, i64, i1 } } %167, 0 - br i1 %.fca.0.extract11.i.9, label %__hugr__.const_fun_284.290.exit.9, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.9, label %__hugr__.const_fun_287.338.exit.9, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.9: ; preds = %__hugr__.const_fun_284.290.exit.8 +__hugr__.const_fun_287.338.exit.9: ; preds = %__hugr__.const_fun_287.338.exit.8 %168 = extractvalue { i1, { i1, i64, i1 } } %167, 1 %169 = getelementptr inbounds i8, i8* %111, i64 216 %170 = bitcast i8* %169 to { i1, i64, i1 }* store { i1, i64, i1 } %168, { i1, i64, i1 }* %170, align 4 tail call void @heap_free(i8* nonnull %63) tail call void @heap_free(i8* nonnull %64) - br label %__barray_check_bounds.exit888 + br label %__barray_check_bounds.exit882 -cond_165_case_0: ; preds = %cond_exit_165 +cond_169_case_0: ; preds = %cond_exit_169 %171 = load i64, i64* %114, align 4 %172 = or i64 %171, -1024 store i64 %172, i64* %114, align 4 %173 = icmp eq i64 %172, -1 - br i1 %173, label %loop_out139, label %mask_block_err.i886 + br i1 %173, label %loop_out135, label %mask_block_err.i880 -mask_block_err.i886: ; preds = %cond_165_case_0 +mask_block_err.i880: ; preds = %cond_169_case_0 tail call void @panic(i32 1002, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @"e_Array cont.EFA5AC45.0", i64 0, i64 0)) unreachable -__barray_check_bounds.exit888: ; preds = %__hugr__.const_fun_284.290.exit.9, %cond_exit_165 - %"167_0.0989" = phi i64 [ 0, %__hugr__.const_fun_284.290.exit.9 ], [ %174, %cond_exit_165 ] - %174 = add nuw nsw i64 %"167_0.0989", 1 - %175 = lshr i64 %"167_0.0989", 6 +__barray_check_bounds.exit882: ; preds = %__hugr__.const_fun_287.338.exit.9, %cond_exit_169 + %"172_0.0983" = phi i64 [ 0, %__hugr__.const_fun_287.338.exit.9 ], [ %174, %cond_exit_169 ] + %174 = add nuw nsw i64 %"172_0.0983", 1 + %175 = lshr i64 %"172_0.0983", 6 %176 = getelementptr inbounds i64, i64* %114, i64 %175 %177 = load i64, i64* %176, align 4 - %178 = shl nuw nsw i64 1, %"167_0.0989" + %178 = shl nuw nsw i64 1, %"172_0.0983" %179 = and i64 %177, %178 %.not = icmp eq i64 %179, 0 - br i1 %.not, label %__barray_mask_borrow.exit893, label %cond_exit_165 + br i1 %.not, label %__barray_mask_borrow.exit887, label %cond_exit_169 -__barray_mask_borrow.exit893: ; preds = %__barray_check_bounds.exit888 +__barray_mask_borrow.exit887: ; preds = %__barray_check_bounds.exit882 %180 = xor i64 %177, %178 store i64 %180, i64* %176, align 4 - %181 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %112, i64 %"167_0.0989" + %181 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %112, i64 %"172_0.0983" %182 = load { i1, i64, i1 }, { i1, i64, i1 }* %181, align 4 - %.fca.0.extract511 = extractvalue { i1, i64, i1 } %182, 0 - br i1 %.fca.0.extract511, label %cond_501_case_1, label %cond_exit_165 + %.fca.0.extract505 = extractvalue { i1, i64, i1 } %182, 0 + br i1 %.fca.0.extract505, label %cond_496_case_1, label %cond_exit_169 -cond_exit_165: ; preds = %cond_501_case_1, %__barray_mask_borrow.exit893, %__barray_check_bounds.exit888 - %183 = icmp ult i64 %"167_0.0989", 9 - br i1 %183, label %__barray_check_bounds.exit888, label %cond_165_case_0 +cond_exit_169: ; preds = %cond_496_case_1, %__barray_mask_borrow.exit887, %__barray_check_bounds.exit882 + %183 = icmp ult i64 %"172_0.0983", 9 + br i1 %183, label %__barray_check_bounds.exit882, label %cond_169_case_0 -loop_out139: ; preds = %cond_165_case_0 +loop_out135: ; preds = %cond_169_case_0 tail call void @heap_free(i8* %111) tail call void @heap_free(i8* nonnull %113) %184 = load i64, i64* %87, align 4 %185 = and i64 %184, 1023 store i64 %185, i64* %87, align 4 %186 = icmp eq i64 %185, 0 - br i1 %186, label %__barray_check_none_borrowed.exit898, label %mask_block_err.i897 + br i1 %186, label %__barray_check_none_borrowed.exit892, label %mask_block_err.i891 -__barray_check_none_borrowed.exit898: ; preds = %loop_out139 +__barray_check_none_borrowed.exit892: ; preds = %loop_out135 %187 = tail call i8* @heap_alloc(i64 10) %188 = tail call i8* @heap_alloc(i64 8) %189 = bitcast i8* %188 to i64* store i64 0, i64* %189, align 1 %190 = load { i1, i64, i1 }, { i1, i64, i1 }* %85, align 4 - %.fca.0.extract.i899 = extractvalue { i1, i64, i1 } %190, 0 - %.fca.1.extract.i900 = extractvalue { i1, i64, i1 } %190, 1 - br i1 %.fca.0.extract.i899, label %cond_300_case_1.i, label %cond_300_case_0.i + %.fca.0.extract.i893 = extractvalue { i1, i64, i1 } %190, 0 + %.fca.1.extract.i894 = extractvalue { i1, i64, i1 } %190, 1 + br i1 %.fca.0.extract.i893, label %cond_300_case_1.i, label %cond_300_case_0.i -mask_block_err.i897: ; preds = %loop_out139 +mask_block_err.i891: ; preds = %loop_out135 tail call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable -cond_501_case_1: ; preds = %__barray_mask_borrow.exit893 - %.fca.1.extract512 = extractvalue { i1, i64, i1 } %182, 1 - tail call void @___dec_future_refcount(i64 %.fca.1.extract512) - br label %cond_exit_165 +cond_496_case_1: ; preds = %__barray_mask_borrow.exit887 + %.fca.1.extract506 = extractvalue { i1, i64, i1 } %182, 1 + tail call void @___dec_future_refcount(i64 %.fca.1.extract506) + br label %cond_exit_169 -cond_300_case_0.i: ; preds = %__barray_check_none_borrowed.exit898 +cond_300_case_0.i: ; preds = %__barray_check_none_borrowed.exit892 %.fca.2.extract.i = extractvalue { i1, i64, i1 } %190, 2 br label %__hugr__.array.__read_bool.3.271.exit -cond_300_case_1.i: ; preds = %__barray_check_none_borrowed.exit898 - %read_bool.i = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900) +cond_300_case_1.i: ; preds = %__barray_check_none_borrowed.exit892 + %read_bool.i = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894) br label %__hugr__.array.__read_bool.3.271.exit __hugr__.array.__read_bool.3.271.exit: ; preds = %cond_300_case_0.i, %cond_300_case_1.i @@ -546,17 +546,17 @@ __hugr__.array.__read_bool.3.271.exit: ; preds = %cond_300_case_0.i, %192 = getelementptr inbounds i8, i8* %84, i64 24 %193 = bitcast i8* %192 to { i1, i64, i1 }* %194 = load { i1, i64, i1 }, { i1, i64, i1 }* %193, align 4 - %.fca.0.extract.i899.1 = extractvalue { i1, i64, i1 } %194, 0 - %.fca.1.extract.i900.1 = extractvalue { i1, i64, i1 } %194, 1 - br i1 %.fca.0.extract.i899.1, label %cond_300_case_1.i.1, label %cond_300_case_0.i.1 + %.fca.0.extract.i893.1 = extractvalue { i1, i64, i1 } %194, 0 + %.fca.1.extract.i894.1 = extractvalue { i1, i64, i1 } %194, 1 + br i1 %.fca.0.extract.i893.1, label %cond_300_case_1.i.1, label %cond_300_case_0.i.1 cond_300_case_0.i.1: ; preds = %__hugr__.array.__read_bool.3.271.exit %.fca.2.extract.i.1 = extractvalue { i1, i64, i1 } %194, 2 br label %__hugr__.array.__read_bool.3.271.exit.1 cond_300_case_1.i.1: ; preds = %__hugr__.array.__read_bool.3.271.exit - %read_bool.i.1 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.1) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.1) + %read_bool.i.1 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.1) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.1) br label %__hugr__.array.__read_bool.3.271.exit.1 __hugr__.array.__read_bool.3.271.exit.1: ; preds = %cond_300_case_1.i.1, %cond_300_case_0.i.1 @@ -567,17 +567,17 @@ __hugr__.array.__read_bool.3.271.exit.1: ; preds = %cond_300_case_1.i.1 %197 = getelementptr inbounds i8, i8* %84, i64 48 %198 = bitcast i8* %197 to { i1, i64, i1 }* %199 = load { i1, i64, i1 }, { i1, i64, i1 }* %198, align 4 - %.fca.0.extract.i899.2 = extractvalue { i1, i64, i1 } %199, 0 - %.fca.1.extract.i900.2 = extractvalue { i1, i64, i1 } %199, 1 - br i1 %.fca.0.extract.i899.2, label %cond_300_case_1.i.2, label %cond_300_case_0.i.2 + %.fca.0.extract.i893.2 = extractvalue { i1, i64, i1 } %199, 0 + %.fca.1.extract.i894.2 = extractvalue { i1, i64, i1 } %199, 1 + br i1 %.fca.0.extract.i893.2, label %cond_300_case_1.i.2, label %cond_300_case_0.i.2 cond_300_case_0.i.2: ; preds = %__hugr__.array.__read_bool.3.271.exit.1 %.fca.2.extract.i.2 = extractvalue { i1, i64, i1 } %199, 2 br label %__hugr__.array.__read_bool.3.271.exit.2 cond_300_case_1.i.2: ; preds = %__hugr__.array.__read_bool.3.271.exit.1 - %read_bool.i.2 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.2) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.2) + %read_bool.i.2 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.2) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.2) br label %__hugr__.array.__read_bool.3.271.exit.2 __hugr__.array.__read_bool.3.271.exit.2: ; preds = %cond_300_case_1.i.2, %cond_300_case_0.i.2 @@ -588,17 +588,17 @@ __hugr__.array.__read_bool.3.271.exit.2: ; preds = %cond_300_case_1.i.2 %202 = getelementptr inbounds i8, i8* %84, i64 72 %203 = bitcast i8* %202 to { i1, i64, i1 }* %204 = load { i1, i64, i1 }, { i1, i64, i1 }* %203, align 4 - %.fca.0.extract.i899.3 = extractvalue { i1, i64, i1 } %204, 0 - %.fca.1.extract.i900.3 = extractvalue { i1, i64, i1 } %204, 1 - br i1 %.fca.0.extract.i899.3, label %cond_300_case_1.i.3, label %cond_300_case_0.i.3 + %.fca.0.extract.i893.3 = extractvalue { i1, i64, i1 } %204, 0 + %.fca.1.extract.i894.3 = extractvalue { i1, i64, i1 } %204, 1 + br i1 %.fca.0.extract.i893.3, label %cond_300_case_1.i.3, label %cond_300_case_0.i.3 cond_300_case_0.i.3: ; preds = %__hugr__.array.__read_bool.3.271.exit.2 %.fca.2.extract.i.3 = extractvalue { i1, i64, i1 } %204, 2 br label %__hugr__.array.__read_bool.3.271.exit.3 cond_300_case_1.i.3: ; preds = %__hugr__.array.__read_bool.3.271.exit.2 - %read_bool.i.3 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.3) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.3) + %read_bool.i.3 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.3) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.3) br label %__hugr__.array.__read_bool.3.271.exit.3 __hugr__.array.__read_bool.3.271.exit.3: ; preds = %cond_300_case_1.i.3, %cond_300_case_0.i.3 @@ -609,17 +609,17 @@ __hugr__.array.__read_bool.3.271.exit.3: ; preds = %cond_300_case_1.i.3 %207 = getelementptr inbounds i8, i8* %84, i64 96 %208 = bitcast i8* %207 to { i1, i64, i1 }* %209 = load { i1, i64, i1 }, { i1, i64, i1 }* %208, align 4 - %.fca.0.extract.i899.4 = extractvalue { i1, i64, i1 } %209, 0 - %.fca.1.extract.i900.4 = extractvalue { i1, i64, i1 } %209, 1 - br i1 %.fca.0.extract.i899.4, label %cond_300_case_1.i.4, label %cond_300_case_0.i.4 + %.fca.0.extract.i893.4 = extractvalue { i1, i64, i1 } %209, 0 + %.fca.1.extract.i894.4 = extractvalue { i1, i64, i1 } %209, 1 + br i1 %.fca.0.extract.i893.4, label %cond_300_case_1.i.4, label %cond_300_case_0.i.4 cond_300_case_0.i.4: ; preds = %__hugr__.array.__read_bool.3.271.exit.3 %.fca.2.extract.i.4 = extractvalue { i1, i64, i1 } %209, 2 br label %__hugr__.array.__read_bool.3.271.exit.4 cond_300_case_1.i.4: ; preds = %__hugr__.array.__read_bool.3.271.exit.3 - %read_bool.i.4 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.4) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.4) + %read_bool.i.4 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.4) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.4) br label %__hugr__.array.__read_bool.3.271.exit.4 __hugr__.array.__read_bool.3.271.exit.4: ; preds = %cond_300_case_1.i.4, %cond_300_case_0.i.4 @@ -630,17 +630,17 @@ __hugr__.array.__read_bool.3.271.exit.4: ; preds = %cond_300_case_1.i.4 %212 = getelementptr inbounds i8, i8* %84, i64 120 %213 = bitcast i8* %212 to { i1, i64, i1 }* %214 = load { i1, i64, i1 }, { i1, i64, i1 }* %213, align 4 - %.fca.0.extract.i899.5 = extractvalue { i1, i64, i1 } %214, 0 - %.fca.1.extract.i900.5 = extractvalue { i1, i64, i1 } %214, 1 - br i1 %.fca.0.extract.i899.5, label %cond_300_case_1.i.5, label %cond_300_case_0.i.5 + %.fca.0.extract.i893.5 = extractvalue { i1, i64, i1 } %214, 0 + %.fca.1.extract.i894.5 = extractvalue { i1, i64, i1 } %214, 1 + br i1 %.fca.0.extract.i893.5, label %cond_300_case_1.i.5, label %cond_300_case_0.i.5 cond_300_case_0.i.5: ; preds = %__hugr__.array.__read_bool.3.271.exit.4 %.fca.2.extract.i.5 = extractvalue { i1, i64, i1 } %214, 2 br label %__hugr__.array.__read_bool.3.271.exit.5 cond_300_case_1.i.5: ; preds = %__hugr__.array.__read_bool.3.271.exit.4 - %read_bool.i.5 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.5) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.5) + %read_bool.i.5 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.5) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.5) br label %__hugr__.array.__read_bool.3.271.exit.5 __hugr__.array.__read_bool.3.271.exit.5: ; preds = %cond_300_case_1.i.5, %cond_300_case_0.i.5 @@ -651,17 +651,17 @@ __hugr__.array.__read_bool.3.271.exit.5: ; preds = %cond_300_case_1.i.5 %217 = getelementptr inbounds i8, i8* %84, i64 144 %218 = bitcast i8* %217 to { i1, i64, i1 }* %219 = load { i1, i64, i1 }, { i1, i64, i1 }* %218, align 4 - %.fca.0.extract.i899.6 = extractvalue { i1, i64, i1 } %219, 0 - %.fca.1.extract.i900.6 = extractvalue { i1, i64, i1 } %219, 1 - br i1 %.fca.0.extract.i899.6, label %cond_300_case_1.i.6, label %cond_300_case_0.i.6 + %.fca.0.extract.i893.6 = extractvalue { i1, i64, i1 } %219, 0 + %.fca.1.extract.i894.6 = extractvalue { i1, i64, i1 } %219, 1 + br i1 %.fca.0.extract.i893.6, label %cond_300_case_1.i.6, label %cond_300_case_0.i.6 cond_300_case_0.i.6: ; preds = %__hugr__.array.__read_bool.3.271.exit.5 %.fca.2.extract.i.6 = extractvalue { i1, i64, i1 } %219, 2 br label %__hugr__.array.__read_bool.3.271.exit.6 cond_300_case_1.i.6: ; preds = %__hugr__.array.__read_bool.3.271.exit.5 - %read_bool.i.6 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.6) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.6) + %read_bool.i.6 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.6) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.6) br label %__hugr__.array.__read_bool.3.271.exit.6 __hugr__.array.__read_bool.3.271.exit.6: ; preds = %cond_300_case_1.i.6, %cond_300_case_0.i.6 @@ -672,17 +672,17 @@ __hugr__.array.__read_bool.3.271.exit.6: ; preds = %cond_300_case_1.i.6 %222 = getelementptr inbounds i8, i8* %84, i64 168 %223 = bitcast i8* %222 to { i1, i64, i1 }* %224 = load { i1, i64, i1 }, { i1, i64, i1 }* %223, align 4 - %.fca.0.extract.i899.7 = extractvalue { i1, i64, i1 } %224, 0 - %.fca.1.extract.i900.7 = extractvalue { i1, i64, i1 } %224, 1 - br i1 %.fca.0.extract.i899.7, label %cond_300_case_1.i.7, label %cond_300_case_0.i.7 + %.fca.0.extract.i893.7 = extractvalue { i1, i64, i1 } %224, 0 + %.fca.1.extract.i894.7 = extractvalue { i1, i64, i1 } %224, 1 + br i1 %.fca.0.extract.i893.7, label %cond_300_case_1.i.7, label %cond_300_case_0.i.7 cond_300_case_0.i.7: ; preds = %__hugr__.array.__read_bool.3.271.exit.6 %.fca.2.extract.i.7 = extractvalue { i1, i64, i1 } %224, 2 br label %__hugr__.array.__read_bool.3.271.exit.7 cond_300_case_1.i.7: ; preds = %__hugr__.array.__read_bool.3.271.exit.6 - %read_bool.i.7 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.7) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.7) + %read_bool.i.7 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.7) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.7) br label %__hugr__.array.__read_bool.3.271.exit.7 __hugr__.array.__read_bool.3.271.exit.7: ; preds = %cond_300_case_1.i.7, %cond_300_case_0.i.7 @@ -693,17 +693,17 @@ __hugr__.array.__read_bool.3.271.exit.7: ; preds = %cond_300_case_1.i.7 %227 = getelementptr inbounds i8, i8* %84, i64 192 %228 = bitcast i8* %227 to { i1, i64, i1 }* %229 = load { i1, i64, i1 }, { i1, i64, i1 }* %228, align 4 - %.fca.0.extract.i899.8 = extractvalue { i1, i64, i1 } %229, 0 - %.fca.1.extract.i900.8 = extractvalue { i1, i64, i1 } %229, 1 - br i1 %.fca.0.extract.i899.8, label %cond_300_case_1.i.8, label %cond_300_case_0.i.8 + %.fca.0.extract.i893.8 = extractvalue { i1, i64, i1 } %229, 0 + %.fca.1.extract.i894.8 = extractvalue { i1, i64, i1 } %229, 1 + br i1 %.fca.0.extract.i893.8, label %cond_300_case_1.i.8, label %cond_300_case_0.i.8 cond_300_case_0.i.8: ; preds = %__hugr__.array.__read_bool.3.271.exit.7 %.fca.2.extract.i.8 = extractvalue { i1, i64, i1 } %229, 2 br label %__hugr__.array.__read_bool.3.271.exit.8 cond_300_case_1.i.8: ; preds = %__hugr__.array.__read_bool.3.271.exit.7 - %read_bool.i.8 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.8) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.8) + %read_bool.i.8 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.8) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.8) br label %__hugr__.array.__read_bool.3.271.exit.8 __hugr__.array.__read_bool.3.271.exit.8: ; preds = %cond_300_case_1.i.8, %cond_300_case_0.i.8 @@ -714,17 +714,17 @@ __hugr__.array.__read_bool.3.271.exit.8: ; preds = %cond_300_case_1.i.8 %232 = getelementptr inbounds i8, i8* %84, i64 216 %233 = bitcast i8* %232 to { i1, i64, i1 }* %234 = load { i1, i64, i1 }, { i1, i64, i1 }* %233, align 4 - %.fca.0.extract.i899.9 = extractvalue { i1, i64, i1 } %234, 0 - %.fca.1.extract.i900.9 = extractvalue { i1, i64, i1 } %234, 1 - br i1 %.fca.0.extract.i899.9, label %cond_300_case_1.i.9, label %cond_300_case_0.i.9 + %.fca.0.extract.i893.9 = extractvalue { i1, i64, i1 } %234, 0 + %.fca.1.extract.i894.9 = extractvalue { i1, i64, i1 } %234, 1 + br i1 %.fca.0.extract.i893.9, label %cond_300_case_1.i.9, label %cond_300_case_0.i.9 cond_300_case_0.i.9: ; preds = %__hugr__.array.__read_bool.3.271.exit.8 %.fca.2.extract.i.9 = extractvalue { i1, i64, i1 } %234, 2 br label %__hugr__.array.__read_bool.3.271.exit.9 cond_300_case_1.i.9: ; preds = %__hugr__.array.__read_bool.3.271.exit.8 - %read_bool.i.9 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.9) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.9) + %read_bool.i.9 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.9) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.9) br label %__hugr__.array.__read_bool.3.271.exit.9 __hugr__.array.__read_bool.3.271.exit.9: ; preds = %cond_300_case_1.i.9, %cond_300_case_0.i.9 @@ -738,9 +738,9 @@ __hugr__.array.__read_bool.3.271.exit.9: ; preds = %cond_300_case_1.i.9 %238 = and i64 %237, 1023 store i64 %238, i64* %189, align 4 %239 = icmp eq i64 %238, 0 - br i1 %239, label %__barray_check_none_borrowed.exit905, label %mask_block_err.i904 + br i1 %239, label %__barray_check_none_borrowed.exit899, label %mask_block_err.i898 -__barray_check_none_borrowed.exit905: ; preds = %__hugr__.array.__read_bool.3.271.exit.9 +__barray_check_none_borrowed.exit899: ; preds = %__hugr__.array.__read_bool.3.271.exit.9 %out_arr_alloca = alloca <{ i32, i32, i1*, i1* }>, align 8 %x_ptr = getelementptr inbounds <{ i32, i32, i1*, i1* }>, <{ i32, i32, i1*, i1* }>* %out_arr_alloca, i64 0, i32 0 %y_ptr = getelementptr inbounds <{ i32, i32, i1*, i1* }>, <{ i32, i32, i1*, i1* }>* %out_arr_alloca, i64 0, i32 1 @@ -756,52 +756,52 @@ __barray_check_none_borrowed.exit905: ; preds = %__hugr__.array.__re store i8* %187, i8** %242, align 8 store i1* %.sub, i1** %mask_ptr, align 8 call void @print_bool_arr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @res_cs.46C3C4B5.0, i64 0, i64 0), i64 15, <{ i32, i32, i1*, i1* }>* nonnull %out_arr_alloca) - br label %__barray_check_bounds.exit913 + br label %__barray_check_bounds.exit907 -mask_block_err.i904: ; preds = %__hugr__.array.__read_bool.3.271.exit.9 +mask_block_err.i898: ; preds = %__hugr__.array.__read_bool.3.271.exit.9 tail call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable -__barray_check_bounds.exit913: ; preds = %cond_exit_95.1, %__barray_check_none_borrowed.exit905 - %"90_0.sroa.0.0972" = phi i64 [ 0, %__barray_check_none_borrowed.exit905 ], [ %252, %cond_exit_95.1 ] - %243 = or i64 %"90_0.sroa.0.0972", 1 - %244 = lshr i64 %"90_0.sroa.0.0972", 6 +__barray_check_bounds.exit907: ; preds = %cond_exit_95.1, %__barray_check_none_borrowed.exit899 + %"90_0.sroa.0.0966" = phi i64 [ 0, %__barray_check_none_borrowed.exit899 ], [ %252, %cond_exit_95.1 ] + %243 = or i64 %"90_0.sroa.0.0966", 1 + %244 = lshr i64 %"90_0.sroa.0.0966", 6 %245 = getelementptr inbounds i64, i64* %7, i64 %244 %246 = load i64, i64* %245, align 4 - %247 = and i64 %"90_0.sroa.0.0972", 62 + %247 = and i64 %"90_0.sroa.0.0966", 62 %248 = shl nuw i64 1, %247 %249 = and i64 %246, %248 - %.not.i914 = icmp eq i64 %249, 0 - br i1 %.not.i914, label %panic.i915, label %cond_exit_95 + %.not.i908 = icmp eq i64 %249, 0 + br i1 %.not.i908, label %panic.i909, label %cond_exit_95 -panic.i915: ; preds = %cond_exit_95, %__barray_check_bounds.exit913 +panic.i909: ; preds = %cond_exit_95, %__barray_check_bounds.exit907 call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -cond_exit_95: ; preds = %__barray_check_bounds.exit913 +cond_exit_95: ; preds = %__barray_check_bounds.exit907 %250 = xor i64 %246, %248 store i64 %250, i64* %245, align 4 - %251 = getelementptr inbounds i64, i64* %5, i64 %"90_0.sroa.0.0972" - store i64 %"90_0.sroa.0.0972", i64* %251, align 4 - %252 = add nuw nsw i64 %"90_0.sroa.0.0972", 2 - %253 = lshr i64 %"90_0.sroa.0.0972", 6 + %251 = getelementptr inbounds i64, i64* %5, i64 %"90_0.sroa.0.0966" + store i64 %"90_0.sroa.0.0966", i64* %251, align 4 + %252 = add nuw nsw i64 %"90_0.sroa.0.0966", 2 + %253 = lshr i64 %"90_0.sroa.0.0966", 6 %254 = getelementptr inbounds i64, i64* %7, i64 %253 %255 = load i64, i64* %254, align 4 %256 = and i64 %243, 63 %257 = shl nuw i64 1, %256 %258 = and i64 %255, %257 - %.not.i914.1 = icmp eq i64 %258, 0 - br i1 %.not.i914.1, label %panic.i915, label %cond_exit_95.1 + %.not.i908.1 = icmp eq i64 %258, 0 + br i1 %.not.i908.1, label %panic.i909, label %cond_exit_95.1 cond_exit_95.1: ; preds = %cond_exit_95 %259 = xor i64 %255, %257 store i64 %259, i64* %254, align 4 %260 = getelementptr inbounds i64, i64* %5, i64 %243 store i64 %243, i64* %260, align 4 - %exitcond983.not.1 = icmp eq i64 %252, 100 - br i1 %exitcond983.not.1, label %loop_out212, label %__barray_check_bounds.exit913 + %exitcond977.not.1 = icmp eq i64 %252, 100 + br i1 %exitcond977.not.1, label %loop_out208, label %__barray_check_bounds.exit907 -loop_out212: ; preds = %cond_exit_95.1 +loop_out208: ; preds = %cond_exit_95.1 %261 = getelementptr inbounds i8, i8* %6, i64 8 %262 = bitcast i8* %261 to i64* %263 = load i64, i64* %262, align 4 @@ -811,9 +811,9 @@ loop_out212: ; preds = %cond_exit_95.1 %266 = icmp eq i64 %265, 0 %267 = icmp eq i64 %264, 0 %or.cond = select i1 %266, i1 %267, i1 false - br i1 %or.cond, label %__barray_check_none_borrowed.exit921, label %mask_block_err.i920 + br i1 %or.cond, label %__barray_check_none_borrowed.exit915, label %mask_block_err.i914 -__barray_check_none_borrowed.exit921: ; preds = %loop_out212 +__barray_check_none_borrowed.exit915: ; preds = %loop_out208 %268 = call i8* @heap_alloc(i64 800) %269 = bitcast i8* %268 to i64* %270 = call i8* @heap_alloc(i64 16) @@ -827,62 +827,62 @@ __barray_check_none_borrowed.exit921: ; preds = %loop_out212 %274 = load i64, i64* %7, align 4 %275 = icmp eq i64 %274, 0 %276 = icmp eq i64 %273, 0 - %or.cond986 = select i1 %275, i1 %276, i1 false - br i1 %or.cond986, label %__barray_check_none_borrowed.exit926, label %mask_block_err.i925 + %or.cond980 = select i1 %275, i1 %276, i1 false + br i1 %or.cond980, label %__barray_check_none_borrowed.exit920, label %mask_block_err.i919 -mask_block_err.i920: ; preds = %loop_out212 +mask_block_err.i914: ; preds = %loop_out208 call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable -__barray_check_none_borrowed.exit926: ; preds = %__barray_check_none_borrowed.exit921 - %out_arr_alloca287 = alloca <{ i32, i32, i64*, i1* }>, align 8 - %x_ptr288 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca287, i64 0, i32 0 - %y_ptr289 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca287, i64 0, i32 1 - %arr_ptr290 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca287, i64 0, i32 2 - %mask_ptr291 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca287, i64 0, i32 3 +__barray_check_none_borrowed.exit920: ; preds = %__barray_check_none_borrowed.exit915 + %out_arr_alloca282 = alloca <{ i32, i32, i64*, i1* }>, align 8 + %x_ptr283 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca282, i64 0, i32 0 + %y_ptr284 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca282, i64 0, i32 1 + %arr_ptr285 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca282, i64 0, i32 2 + %mask_ptr286 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca282, i64 0, i32 3 %277 = alloca [100 x i1], align 1 - %.sub635 = getelementptr inbounds [100 x i1], [100 x i1]* %277, i64 0, i64 0 + %.sub629 = getelementptr inbounds [100 x i1], [100 x i1]* %277, i64 0, i64 0 %278 = bitcast [100 x i1]* %277 to i8* call void @llvm.memset.p0i8.i64(i8* noundef nonnull align 1 dereferenceable(100) %278, i8 0, i64 100, i1 false) - store i32 100, i32* %x_ptr288, align 8 - store i32 1, i32* %y_ptr289, align 4 - %279 = bitcast i64** %arr_ptr290 to i8** + store i32 100, i32* %x_ptr283, align 8 + store i32 1, i32* %y_ptr284, align 4 + %279 = bitcast i64** %arr_ptr285 to i8** store i8* %4, i8** %279, align 8 - store i1* %.sub635, i1** %mask_ptr291, align 8 - call void @print_int_arr(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @res_is.F21393DB.0, i64 0, i64 0), i64 14, <{ i32, i32, i64*, i1* }>* nonnull %out_arr_alloca287) - br label %__barray_check_bounds.exit934 + store i1* %.sub629, i1** %mask_ptr286, align 8 + call void @print_int_arr(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @res_is.F21393DB.0, i64 0, i64 0), i64 14, <{ i32, i32, i64*, i1* }>* nonnull %out_arr_alloca282) + br label %__barray_check_bounds.exit928 -mask_block_err.i925: ; preds = %__barray_check_none_borrowed.exit921 +mask_block_err.i919: ; preds = %__barray_check_none_borrowed.exit915 call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable -__barray_check_bounds.exit934: ; preds = %cond_exit_130, %__barray_check_none_borrowed.exit926 - %"125_0.sroa.0.0974" = phi i64 [ 0, %__barray_check_none_borrowed.exit926 ], [ %280, %cond_exit_130 ] - %280 = add nuw nsw i64 %"125_0.sroa.0.0974", 1 - %281 = lshr i64 %"125_0.sroa.0.0974", 6 +__barray_check_bounds.exit928: ; preds = %cond_exit_130, %__barray_check_none_borrowed.exit920 + %"125_0.sroa.0.0968" = phi i64 [ 0, %__barray_check_none_borrowed.exit920 ], [ %280, %cond_exit_130 ] + %280 = add nuw nsw i64 %"125_0.sroa.0.0968", 1 + %281 = lshr i64 %"125_0.sroa.0.0968", 6 %282 = getelementptr inbounds i64, i64* %3, i64 %281 %283 = load i64, i64* %282, align 4 - %284 = and i64 %"125_0.sroa.0.0974", 63 + %284 = and i64 %"125_0.sroa.0.0968", 63 %285 = shl nuw i64 1, %284 %286 = and i64 %283, %285 - %.not.i935 = icmp eq i64 %286, 0 - br i1 %.not.i935, label %panic.i936, label %cond_exit_130 + %.not.i929 = icmp eq i64 %286, 0 + br i1 %.not.i929, label %panic.i930, label %cond_exit_130 -panic.i936: ; preds = %__barray_check_bounds.exit934 +panic.i930: ; preds = %__barray_check_bounds.exit928 call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -cond_exit_130: ; preds = %__barray_check_bounds.exit934 - %287 = sitofp i64 %"125_0.sroa.0.0974" to double +cond_exit_130: ; preds = %__barray_check_bounds.exit928 + %287 = sitofp i64 %"125_0.sroa.0.0968" to double %288 = fmul double %287, 6.250000e-02 %289 = xor i64 %283, %285 store i64 %289, i64* %282, align 4 - %290 = getelementptr inbounds double, double* %1, i64 %"125_0.sroa.0.0974" + %290 = getelementptr inbounds double, double* %1, i64 %"125_0.sroa.0.0968" store double %288, double* %290, align 8 - %exitcond984.not = icmp eq i64 %280, 100 - br i1 %exitcond984.not, label %loop_out299, label %__barray_check_bounds.exit934 + %exitcond978.not = icmp eq i64 %280, 100 + br i1 %exitcond978.not, label %loop_out294, label %__barray_check_bounds.exit928 -loop_out299: ; preds = %cond_exit_130 +loop_out294: ; preds = %cond_exit_130 %291 = getelementptr inbounds i8, i8* %2, i64 8 %292 = bitcast i8* %291 to i64* %293 = load i64, i64* %292, align 4 @@ -891,10 +891,10 @@ loop_out299: ; preds = %cond_exit_130 %295 = load i64, i64* %3, align 4 %296 = icmp eq i64 %295, 0 %297 = icmp eq i64 %294, 0 - %or.cond987 = select i1 %296, i1 %297, i1 false - br i1 %or.cond987, label %__barray_check_none_borrowed.exit942, label %mask_block_err.i941 + %or.cond981 = select i1 %296, i1 %297, i1 false + br i1 %or.cond981, label %__barray_check_none_borrowed.exit936, label %mask_block_err.i935 -__barray_check_none_borrowed.exit942: ; preds = %loop_out299 +__barray_check_none_borrowed.exit936: ; preds = %loop_out294 %298 = call i8* @heap_alloc(i64 800) %299 = bitcast i8* %298 to double* %300 = call i8* @heap_alloc(i64 16) @@ -908,32 +908,32 @@ __barray_check_none_borrowed.exit942: ; preds = %loop_out299 %304 = load i64, i64* %3, align 4 %305 = icmp eq i64 %304, 0 %306 = icmp eq i64 %303, 0 - %or.cond988 = select i1 %305, i1 %306, i1 false - br i1 %or.cond988, label %__barray_check_none_borrowed.exit947, label %mask_block_err.i946 + %or.cond982 = select i1 %305, i1 %306, i1 false + br i1 %or.cond982, label %__barray_check_none_borrowed.exit941, label %mask_block_err.i940 -mask_block_err.i941: ; preds = %loop_out299 +mask_block_err.i935: ; preds = %loop_out294 call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable -__barray_check_none_borrowed.exit947: ; preds = %__barray_check_none_borrowed.exit942 - %out_arr_alloca377 = alloca <{ i32, i32, double*, i1* }>, align 8 - %x_ptr378 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca377, i64 0, i32 0 - %y_ptr379 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca377, i64 0, i32 1 - %arr_ptr380 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca377, i64 0, i32 2 - %mask_ptr381 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca377, i64 0, i32 3 +__barray_check_none_borrowed.exit941: ; preds = %__barray_check_none_borrowed.exit936 + %out_arr_alloca371 = alloca <{ i32, i32, double*, i1* }>, align 8 + %x_ptr372 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca371, i64 0, i32 0 + %y_ptr373 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca371, i64 0, i32 1 + %arr_ptr374 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca371, i64 0, i32 2 + %mask_ptr375 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca371, i64 0, i32 3 %307 = alloca [100 x i1], align 1 - %.sub736 = getelementptr inbounds [100 x i1], [100 x i1]* %307, i64 0, i64 0 + %.sub730 = getelementptr inbounds [100 x i1], [100 x i1]* %307, i64 0, i64 0 %308 = bitcast [100 x i1]* %307 to i8* call void @llvm.memset.p0i8.i64(i8* noundef nonnull align 1 dereferenceable(100) %308, i8 0, i64 100, i1 false) - store i32 100, i32* %x_ptr378, align 8 - store i32 1, i32* %y_ptr379, align 4 - %309 = bitcast double** %arr_ptr380 to i8** + store i32 100, i32* %x_ptr372, align 8 + store i32 1, i32* %y_ptr373, align 4 + %309 = bitcast double** %arr_ptr374 to i8** store i8* %0, i8** %309, align 8 - store i1* %.sub736, i1** %mask_ptr381, align 8 - call void @print_float_arr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @res_fs.CBD4AF54.0, i64 0, i64 0), i64 16, <{ i32, i32, double*, i1* }>* nonnull %out_arr_alloca377) + store i1* %.sub730, i1** %mask_ptr375, align 8 + call void @print_float_arr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @res_fs.CBD4AF54.0, i64 0, i64 0), i64 16, <{ i32, i32, double*, i1* }>* nonnull %out_arr_alloca371) ret void -mask_block_err.i946: ; preds = %__barray_check_none_borrowed.exit942 +mask_block_err.i940: ; preds = %__barray_check_none_borrowed.exit936 call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu index ed180d102..757f214d3 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu @@ -38,8 +38,8 @@ entry: br label %cond_20_case_1.i cond_20_case_1.i: ; preds = %cond_exit_20.i, %entry - %"15_0.sroa.0.0295.i" = phi i64 [ 0, %entry ], [ %5, %cond_exit_20.i ] - %5 = add nuw nsw i64 %"15_0.sroa.0.0295.i", 1 + %"15_0.sroa.0.0294.i" = phi i64 [ 0, %entry ], [ %5, %cond_exit_20.i ] + %5 = add nuw nsw i64 %"15_0.sroa.0.0294.i", 1 %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.i.i = icmp eq i64 %qalloc.i.i, -1 br i1 %not_max.not.i.i, label %id_bb.i.i, label %reset_bb.i.i @@ -59,10 +59,10 @@ cond_217_case_0.i.i: ; preds = %id_bb.i.i unreachable __barray_check_bounds.exit.i: ; preds = %id_bb.i.i - %8 = lshr i64 %"15_0.sroa.0.0295.i", 6 + %8 = lshr i64 %"15_0.sroa.0.0294.i", 6 %9 = getelementptr inbounds i64, i64* %4, i64 %8 %10 = load i64, i64* %9, align 4 - %11 = shl nuw nsw i64 1, %"15_0.sroa.0.0295.i" + %11 = shl nuw nsw i64 1, %"15_0.sroa.0.0294.i" %12 = and i64 %10, %11 %.not.i.i = icmp eq i64 %12, 0 br i1 %.not.i.i, label %panic.i.i, label %cond_exit_20.i @@ -75,7 +75,7 @@ cond_exit_20.i: ; preds = %__barray_check_boun %.fca.1.extract.i.i = extractvalue { i1, i64 } %7, 1 %13 = xor i64 %10, %11 store i64 %13, i64* %9, align 4 - %14 = getelementptr inbounds i64, i64* %2, i64 %"15_0.sroa.0.0295.i" + %14 = getelementptr inbounds i64, i64* %2, i64 %"15_0.sroa.0.0294.i" store i64 %.fca.1.extract.i.i, i64* %14, align 4 %exitcond.not.i = icmp eq i64 %5, 10 br i1 %exitcond.not.i, label %loop_out.i, label %cond_20_case_1.i @@ -83,10 +83,10 @@ cond_exit_20.i: ; preds = %__barray_check_boun loop_out.i: ; preds = %cond_exit_20.i %15 = load i64, i64* %4, align 4 %16 = and i64 %15, 1 - %.not.i259.i = icmp eq i64 %16, 0 - br i1 %.not.i259.i, label %__barray_mask_borrow.exit.i, label %panic.i260.i + %.not.i258.i = icmp eq i64 %16, 0 + br i1 %.not.i258.i, label %__barray_mask_borrow.exit.i, label %panic.i259.i -panic.i260.i: ; preds = %loop_out.i +panic.i259.i: ; preds = %loop_out.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable @@ -97,27 +97,27 @@ __barray_mask_borrow.exit.i: ; preds = %loop_out.i tail call void @___rxy(i64 %18, double 0x400921FB54442D18, double 0.000000e+00) %19 = load i64, i64* %4, align 4 %20 = and i64 %19, 1 - %.not.i261.i = icmp eq i64 %20, 0 - br i1 %.not.i261.i, label %panic.i262.i, label %__barray_mask_return.exit263.i + %.not.i260.i = icmp eq i64 %20, 0 + br i1 %.not.i260.i, label %panic.i261.i, label %__barray_mask_return.exit262.i -panic.i262.i: ; preds = %__barray_mask_borrow.exit.i +panic.i261.i: ; preds = %__barray_mask_borrow.exit.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit263.i: ; preds = %__barray_mask_borrow.exit.i +__barray_mask_return.exit262.i: ; preds = %__barray_mask_borrow.exit.i %21 = xor i64 %19, 1 store i64 %21, i64* %4, align 4 store i64 %18, i64* %2, align 4 %22 = load i64, i64* %4, align 4 %23 = and i64 %22, 4 - %.not.i264.i = icmp eq i64 %23, 0 - br i1 %.not.i264.i, label %__barray_mask_borrow.exit266.i, label %panic.i265.i + %.not.i263.i = icmp eq i64 %23, 0 + br i1 %.not.i263.i, label %__barray_mask_borrow.exit265.i, label %panic.i264.i -panic.i265.i: ; preds = %__barray_mask_return.exit263.i +panic.i264.i: ; preds = %__barray_mask_return.exit262.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable -__barray_mask_borrow.exit266.i: ; preds = %__barray_mask_return.exit263.i +__barray_mask_borrow.exit265.i: ; preds = %__barray_mask_return.exit262.i %24 = xor i64 %22, 4 store i64 %24, i64* %4, align 4 %25 = getelementptr inbounds i8, i8* %1, i64 16 @@ -126,27 +126,27 @@ __barray_mask_borrow.exit266.i: ; preds = %__barray_mask_retur tail call void @___rxy(i64 %27, double 0x400921FB54442D18, double 0.000000e+00) %28 = load i64, i64* %4, align 4 %29 = and i64 %28, 4 - %.not.i267.i = icmp eq i64 %29, 0 - br i1 %.not.i267.i, label %panic.i268.i, label %__barray_mask_return.exit269.i + %.not.i266.i = icmp eq i64 %29, 0 + br i1 %.not.i266.i, label %panic.i267.i, label %__barray_mask_return.exit268.i -panic.i268.i: ; preds = %__barray_mask_borrow.exit266.i +panic.i267.i: ; preds = %__barray_mask_borrow.exit265.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit269.i: ; preds = %__barray_mask_borrow.exit266.i +__barray_mask_return.exit268.i: ; preds = %__barray_mask_borrow.exit265.i %30 = xor i64 %28, 4 store i64 %30, i64* %4, align 4 store i64 %27, i64* %26, align 4 %31 = load i64, i64* %4, align 4 %32 = and i64 %31, 8 - %.not.i270.i = icmp eq i64 %32, 0 - br i1 %.not.i270.i, label %__barray_mask_borrow.exit272.i, label %panic.i271.i + %.not.i269.i = icmp eq i64 %32, 0 + br i1 %.not.i269.i, label %__barray_mask_borrow.exit271.i, label %panic.i270.i -panic.i271.i: ; preds = %__barray_mask_return.exit269.i +panic.i270.i: ; preds = %__barray_mask_return.exit268.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable -__barray_mask_borrow.exit272.i: ; preds = %__barray_mask_return.exit269.i +__barray_mask_borrow.exit271.i: ; preds = %__barray_mask_return.exit268.i %33 = xor i64 %31, 8 store i64 %33, i64* %4, align 4 %34 = getelementptr inbounds i8, i8* %1, i64 24 @@ -155,27 +155,27 @@ __barray_mask_borrow.exit272.i: ; preds = %__barray_mask_retur tail call void @___rxy(i64 %36, double 0x400921FB54442D18, double 0.000000e+00) %37 = load i64, i64* %4, align 4 %38 = and i64 %37, 8 - %.not.i273.i = icmp eq i64 %38, 0 - br i1 %.not.i273.i, label %panic.i274.i, label %__barray_mask_return.exit275.i + %.not.i272.i = icmp eq i64 %38, 0 + br i1 %.not.i272.i, label %panic.i273.i, label %__barray_mask_return.exit274.i -panic.i274.i: ; preds = %__barray_mask_borrow.exit272.i +panic.i273.i: ; preds = %__barray_mask_borrow.exit271.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit275.i: ; preds = %__barray_mask_borrow.exit272.i +__barray_mask_return.exit274.i: ; preds = %__barray_mask_borrow.exit271.i %39 = xor i64 %37, 8 store i64 %39, i64* %4, align 4 store i64 %36, i64* %35, align 4 %40 = load i64, i64* %4, align 4 %41 = and i64 %40, 512 - %.not.i276.i = icmp eq i64 %41, 0 - br i1 %.not.i276.i, label %__barray_mask_borrow.exit278.i, label %panic.i277.i + %.not.i275.i = icmp eq i64 %41, 0 + br i1 %.not.i275.i, label %__barray_mask_borrow.exit277.i, label %panic.i276.i -panic.i277.i: ; preds = %__barray_mask_return.exit275.i +panic.i276.i: ; preds = %__barray_mask_return.exit274.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable -__barray_mask_borrow.exit278.i: ; preds = %__barray_mask_return.exit275.i +__barray_mask_borrow.exit277.i: ; preds = %__barray_mask_return.exit274.i %42 = xor i64 %40, 512 store i64 %42, i64* %4, align 4 %43 = getelementptr inbounds i8, i8* %1, i64 72 @@ -184,14 +184,14 @@ __barray_mask_borrow.exit278.i: ; preds = %__barray_mask_retur tail call void @___rxy(i64 %45, double 0x400921FB54442D18, double 0.000000e+00) %46 = load i64, i64* %4, align 4 %47 = and i64 %46, 512 - %.not.i279.i = icmp eq i64 %47, 0 - br i1 %.not.i279.i, label %panic.i280.i, label %__barray_mask_return.exit281.i + %.not.i278.i = icmp eq i64 %47, 0 + br i1 %.not.i278.i, label %panic.i279.i, label %__barray_mask_return.exit280.i -panic.i280.i: ; preds = %__barray_mask_borrow.exit278.i +panic.i279.i: ; preds = %__barray_mask_borrow.exit277.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit281.i: ; preds = %__barray_mask_borrow.exit278.i +__barray_mask_return.exit280.i: ; preds = %__barray_mask_borrow.exit277.i %48 = xor i64 %46, 512 store i64 %48, i64* %4, align 4 store i64 %45, i64* %44, align 4 @@ -212,19 +212,19 @@ mask_block_ok.i.i.i.i: ; preds = %cond_exit_353.i.i "__hugr__.$measure_array$$n(10).277.exit.i": ; preds = %mask_block_ok.i.i.i.i tail call void @heap_free(i8* nonnull %1) tail call void @heap_free(i8* nonnull %3) - br label %__barray_check_bounds.exit284.i + br label %__barray_check_bounds.exit283.i mask_block_err.i.i.i.i: ; preds = %mask_block_ok.i.i.i.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @"e_Array cont.EFA5AC45.0", i64 0, i64 0)) unreachable -56: ; preds = %cond_exit_353.i.i, %__barray_mask_return.exit281.i - %"303_0.sroa.15.0.i297.i" = phi i64 [ 0, %__barray_mask_return.exit281.i ], [ %57, %cond_exit_353.i.i ] - %57 = add nuw nsw i64 %"303_0.sroa.15.0.i297.i", 1 - %58 = lshr i64 %"303_0.sroa.15.0.i297.i", 6 +56: ; preds = %cond_exit_353.i.i, %__barray_mask_return.exit280.i + %"303_0.sroa.15.0.i296.i" = phi i64 [ 0, %__barray_mask_return.exit280.i ], [ %57, %cond_exit_353.i.i ] + %57 = add nuw nsw i64 %"303_0.sroa.15.0.i296.i", 1 + %58 = lshr i64 %"303_0.sroa.15.0.i296.i", 6 %59 = getelementptr inbounds i64, i64* %4, i64 %58 %60 = load i64, i64* %59, align 4 - %61 = shl nuw nsw i64 1, %"303_0.sroa.15.0.i297.i" + %61 = shl nuw nsw i64 1, %"303_0.sroa.15.0.i296.i" %62 = and i64 %60, %61 %.not.i99.i.i.i = icmp eq i64 %62, 0 br i1 %.not.i99.i.i.i, label %__barray_check_bounds.exit.i.i, label %panic.i.i.i.i @@ -236,7 +236,7 @@ panic.i.i.i.i: ; preds = %56 __barray_check_bounds.exit.i.i: ; preds = %56 %63 = xor i64 %60, %61 store i64 %63, i64* %59, align 4 - %64 = getelementptr inbounds i64, i64* %2, i64 %"303_0.sroa.15.0.i297.i" + %64 = getelementptr inbounds i64, i64* %2, i64 %"303_0.sroa.15.0.i296.i" %65 = load i64, i64* %64, align 4 %lazy_measure.i.i = tail call i64 @___lazy_measure(i64 %65) tail call void @___qfree(i64 %65) @@ -254,51 +254,51 @@ cond_exit_353.i.i: ; preds = %__barray_check_boun %"367_054.fca.1.insert.i.i" = insertvalue { i1, i64, i1 } { i1 true, i64 poison, i1 poison }, i64 %lazy_measure.i.i, 1 %69 = xor i64 %67, %61 store i64 %69, i64* %66, align 4 - %70 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %50, i64 %"303_0.sroa.15.0.i297.i" + %70 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %50, i64 %"303_0.sroa.15.0.i296.i" store { i1, i64, i1 } %"367_054.fca.1.insert.i.i", { i1, i64, i1 }* %70, align 4 - %exitcond298.not.i = icmp eq i64 %57, 10 - br i1 %exitcond298.not.i, label %mask_block_ok.i.i.i.i, label %56 + %exitcond297.not.i = icmp eq i64 %57, 10 + br i1 %exitcond297.not.i, label %mask_block_ok.i.i.i.i, label %56 -cond_160_case_0.i: ; preds = %cond_exit_160.i +cond_187_case_0.i: ; preds = %cond_exit_187.i %71 = load i64, i64* %52, align 4 %72 = or i64 %71, -1024 store i64 %72, i64* %52, align 4 %73 = icmp eq i64 %72, -1 br i1 %73, label %__hugr__.main.1.exit, label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_160_case_0.i +mask_block_err.i.i: ; preds = %cond_187_case_0.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @"e_Array cont.EFA5AC45.0", i64 0, i64 0)) unreachable -__barray_check_bounds.exit284.i: ; preds = %"__hugr__.$measure_array$$n(10).277.exit.i", %cond_exit_160.i - %"162_0.0.i1" = phi i64 [ 0, %"__hugr__.$measure_array$$n(10).277.exit.i" ], [ %82, %cond_exit_160.i ] - %74 = lshr i64 %"162_0.0.i1", 6 +__barray_check_bounds.exit283.i: ; preds = %"__hugr__.$measure_array$$n(10).277.exit.i", %cond_exit_187.i + %"164_0.0.i1" = phi i64 [ 0, %"__hugr__.$measure_array$$n(10).277.exit.i" ], [ %82, %cond_exit_187.i ] + %74 = lshr i64 %"164_0.0.i1", 6 %75 = getelementptr inbounds i64, i64* %52, i64 %74 %76 = load i64, i64* %75, align 4 - %77 = shl nuw nsw i64 1, %"162_0.0.i1" + %77 = shl nuw nsw i64 1, %"164_0.0.i1" %78 = and i64 %76, %77 %.not.i = icmp eq i64 %78, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit289.i, label %cond_exit_160.i + br i1 %.not.i, label %__barray_mask_borrow.exit288.i, label %cond_exit_187.i -__barray_mask_borrow.exit289.i: ; preds = %__barray_check_bounds.exit284.i +__barray_mask_borrow.exit288.i: ; preds = %__barray_check_bounds.exit283.i %79 = xor i64 %76, %77 store i64 %79, i64* %75, align 4 - %80 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %50, i64 %"162_0.0.i1" + %80 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %50, i64 %"164_0.0.i1" %81 = load { i1, i64, i1 }, { i1, i64, i1 }* %80, align 4 - %.fca.0.extract180.i = extractvalue { i1, i64, i1 } %81, 0 - br i1 %.fca.0.extract180.i, label %cond_85_case_1.i, label %cond_exit_160.i + %.fca.0.extract179.i = extractvalue { i1, i64, i1 } %81, 0 + br i1 %.fca.0.extract179.i, label %cond_87_case_1.i, label %cond_exit_187.i -cond_exit_160.i: ; preds = %cond_85_case_1.i, %__barray_mask_borrow.exit289.i, %__barray_check_bounds.exit284.i - %82 = add nuw nsw i64 %"162_0.0.i1", 1 +cond_exit_187.i: ; preds = %cond_87_case_1.i, %__barray_mask_borrow.exit288.i, %__barray_check_bounds.exit283.i + %82 = add nuw nsw i64 %"164_0.0.i1", 1 %exitcond.not = icmp eq i64 %82, 10 - br i1 %exitcond.not, label %cond_160_case_0.i, label %__barray_check_bounds.exit284.i + br i1 %exitcond.not, label %cond_187_case_0.i, label %__barray_check_bounds.exit283.i -cond_85_case_1.i: ; preds = %__barray_mask_borrow.exit289.i +cond_87_case_1.i: ; preds = %__barray_mask_borrow.exit288.i %.fca.1.extract.i = extractvalue { i1, i64, i1 } %81, 1 tail call void @___dec_future_refcount(i64 %.fca.1.extract.i) - br label %cond_exit_160.i + br label %cond_exit_187.i -__hugr__.main.1.exit: ; preds = %cond_160_case_0.i +__hugr__.main.1.exit: ; preds = %cond_187_case_0.i tail call void @heap_free(i8* %49) tail call void @heap_free(i8* nonnull %51) %83 = tail call i64 @teardown() diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/x86_64-unknown-linux-gnu-print_array/print_array_x86_64-unknown-linux-gnu b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/x86_64-unknown-linux-gnu-print_array/print_array_x86_64-unknown-linux-gnu index ea2f0aff9..2277df0a1 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/x86_64-unknown-linux-gnu-print_array/print_array_x86_64-unknown-linux-gnu +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/x86_64-unknown-linux-gnu-print_array/print_array_x86_64-unknown-linux-gnu @@ -34,8 +34,8 @@ alloca_block: br label %cond_20_case_1 cond_20_case_1: ; preds = %alloca_block, %cond_exit_20 - %"15_0.sroa.0.0961" = phi i64 [ 0, %alloca_block ], [ %12, %cond_exit_20 ] - %12 = add nuw nsw i64 %"15_0.sroa.0.0961", 1 + %"15_0.sroa.0.0955" = phi i64 [ 0, %alloca_block ], [ %12, %cond_exit_20 ] + %12 = add nuw nsw i64 %"15_0.sroa.0.0955", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.i = icmp eq i64 %qalloc.i, -1 br i1 %not_max.not.i, label %id_bb.i, label %reset_bb.i @@ -55,10 +55,10 @@ cond_303_case_0.i: ; preds = %id_bb.i unreachable __barray_check_bounds.exit: ; preds = %id_bb.i - %15 = lshr i64 %"15_0.sroa.0.0961", 6 + %15 = lshr i64 %"15_0.sroa.0.0955", 6 %16 = getelementptr inbounds i64, i64* %11, i64 %15 %17 = load i64, i64* %16, align 4 - %18 = shl nuw nsw i64 1, %"15_0.sroa.0.0961" + %18 = shl nuw nsw i64 1, %"15_0.sroa.0.0955" %19 = and i64 %17, %18 %.not.i = icmp eq i64 %19, 0 br i1 %.not.i, label %panic.i, label %cond_exit_20 @@ -71,7 +71,7 @@ cond_exit_20: ; preds = %__barray_check_boun %.fca.1.extract.i = extractvalue { i1, i64 } %14, 1 %20 = xor i64 %17, %18 store i64 %20, i64* %16, align 4 - %21 = getelementptr inbounds i64, i64* %9, i64 %"15_0.sroa.0.0961" + %21 = getelementptr inbounds i64, i64* %9, i64 %"15_0.sroa.0.0955" store i64 %.fca.1.extract.i, i64* %21, align 4 %exitcond.not = icmp eq i64 %12, 10 br i1 %exitcond.not, label %loop_out, label %cond_20_case_1 @@ -79,10 +79,10 @@ cond_exit_20: ; preds = %__barray_check_boun loop_out: ; preds = %cond_exit_20 %22 = load i64, i64* %11, align 4 %23 = and i64 %22, 1 - %.not.i852 = icmp eq i64 %23, 0 - br i1 %.not.i852, label %__barray_mask_borrow.exit, label %panic.i853 + %.not.i846 = icmp eq i64 %23, 0 + br i1 %.not.i846, label %__barray_mask_borrow.exit, label %panic.i847 -panic.i853: ; preds = %loop_out +panic.i847: ; preds = %loop_out tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable @@ -93,27 +93,27 @@ __barray_mask_borrow.exit: ; preds = %loop_out tail call void @___rxy(i64 %25, double 0x400921FB54442D18, double 0.000000e+00) %26 = load i64, i64* %11, align 4 %27 = and i64 %26, 1 - %.not.i854 = icmp eq i64 %27, 0 - br i1 %.not.i854, label %panic.i855, label %__barray_mask_return.exit856 + %.not.i848 = icmp eq i64 %27, 0 + br i1 %.not.i848, label %panic.i849, label %__barray_mask_return.exit850 -panic.i855: ; preds = %__barray_mask_borrow.exit +panic.i849: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit856: ; preds = %__barray_mask_borrow.exit +__barray_mask_return.exit850: ; preds = %__barray_mask_borrow.exit %28 = xor i64 %26, 1 store i64 %28, i64* %11, align 4 store i64 %25, i64* %9, align 4 %29 = load i64, i64* %11, align 4 %30 = and i64 %29, 4 - %.not.i857 = icmp eq i64 %30, 0 - br i1 %.not.i857, label %__barray_mask_borrow.exit859, label %panic.i858 + %.not.i851 = icmp eq i64 %30, 0 + br i1 %.not.i851, label %__barray_mask_borrow.exit853, label %panic.i852 -panic.i858: ; preds = %__barray_mask_return.exit856 +panic.i852: ; preds = %__barray_mask_return.exit850 tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable -__barray_mask_borrow.exit859: ; preds = %__barray_mask_return.exit856 +__barray_mask_borrow.exit853: ; preds = %__barray_mask_return.exit850 %31 = xor i64 %29, 4 store i64 %31, i64* %11, align 4 %32 = getelementptr inbounds i8, i8* %8, i64 16 @@ -122,27 +122,27 @@ __barray_mask_borrow.exit859: ; preds = %__barray_mask_retur tail call void @___rxy(i64 %34, double 0x400921FB54442D18, double 0.000000e+00) %35 = load i64, i64* %11, align 4 %36 = and i64 %35, 4 - %.not.i860 = icmp eq i64 %36, 0 - br i1 %.not.i860, label %panic.i861, label %__barray_mask_return.exit862 + %.not.i854 = icmp eq i64 %36, 0 + br i1 %.not.i854, label %panic.i855, label %__barray_mask_return.exit856 -panic.i861: ; preds = %__barray_mask_borrow.exit859 +panic.i855: ; preds = %__barray_mask_borrow.exit853 tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit862: ; preds = %__barray_mask_borrow.exit859 +__barray_mask_return.exit856: ; preds = %__barray_mask_borrow.exit853 %37 = xor i64 %35, 4 store i64 %37, i64* %11, align 4 store i64 %34, i64* %33, align 4 %38 = load i64, i64* %11, align 4 %39 = and i64 %38, 8 - %.not.i863 = icmp eq i64 %39, 0 - br i1 %.not.i863, label %__barray_mask_borrow.exit865, label %panic.i864 + %.not.i857 = icmp eq i64 %39, 0 + br i1 %.not.i857, label %__barray_mask_borrow.exit859, label %panic.i858 -panic.i864: ; preds = %__barray_mask_return.exit862 +panic.i858: ; preds = %__barray_mask_return.exit856 tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable -__barray_mask_borrow.exit865: ; preds = %__barray_mask_return.exit862 +__barray_mask_borrow.exit859: ; preds = %__barray_mask_return.exit856 %40 = xor i64 %38, 8 store i64 %40, i64* %11, align 4 %41 = getelementptr inbounds i8, i8* %8, i64 24 @@ -151,27 +151,27 @@ __barray_mask_borrow.exit865: ; preds = %__barray_mask_retur tail call void @___rxy(i64 %43, double 0x400921FB54442D18, double 0.000000e+00) %44 = load i64, i64* %11, align 4 %45 = and i64 %44, 8 - %.not.i866 = icmp eq i64 %45, 0 - br i1 %.not.i866, label %panic.i867, label %__barray_mask_return.exit868 + %.not.i860 = icmp eq i64 %45, 0 + br i1 %.not.i860, label %panic.i861, label %__barray_mask_return.exit862 -panic.i867: ; preds = %__barray_mask_borrow.exit865 +panic.i861: ; preds = %__barray_mask_borrow.exit859 tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit868: ; preds = %__barray_mask_borrow.exit865 +__barray_mask_return.exit862: ; preds = %__barray_mask_borrow.exit859 %46 = xor i64 %44, 8 store i64 %46, i64* %11, align 4 store i64 %43, i64* %42, align 4 %47 = load i64, i64* %11, align 4 %48 = and i64 %47, 512 - %.not.i869 = icmp eq i64 %48, 0 - br i1 %.not.i869, label %__barray_mask_borrow.exit871, label %panic.i870 + %.not.i863 = icmp eq i64 %48, 0 + br i1 %.not.i863, label %__barray_mask_borrow.exit865, label %panic.i864 -panic.i870: ; preds = %__barray_mask_return.exit868 +panic.i864: ; preds = %__barray_mask_return.exit862 tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable -__barray_mask_borrow.exit871: ; preds = %__barray_mask_return.exit868 +__barray_mask_borrow.exit865: ; preds = %__barray_mask_return.exit862 %49 = xor i64 %47, 512 store i64 %49, i64* %11, align 4 %50 = getelementptr inbounds i8, i8* %8, i64 72 @@ -180,14 +180,14 @@ __barray_mask_borrow.exit871: ; preds = %__barray_mask_retur tail call void @___rxy(i64 %52, double 0x400921FB54442D18, double 0.000000e+00) %53 = load i64, i64* %11, align 4 %54 = and i64 %53, 512 - %.not.i872 = icmp eq i64 %54, 0 - br i1 %.not.i872, label %panic.i873, label %__barray_mask_return.exit874 + %.not.i866 = icmp eq i64 %54, 0 + br i1 %.not.i866, label %panic.i867, label %__barray_mask_return.exit868 -panic.i873: ; preds = %__barray_mask_borrow.exit871 +panic.i867: ; preds = %__barray_mask_borrow.exit865 tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit874: ; preds = %__barray_mask_borrow.exit871 +__barray_mask_return.exit868: ; preds = %__barray_mask_borrow.exit865 %55 = xor i64 %53, 512 store i64 %55, i64* %11, align 4 store i64 %52, i64* %51, align 4 @@ -223,13 +223,13 @@ mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @"e_Array cont.EFA5AC45.0", i64 0, i64 0)) unreachable -69: ; preds = %__barray_mask_return.exit874, %cond_exit_443.i - %"393_0.sroa.15.0.i963" = phi i64 [ 0, %__barray_mask_return.exit874 ], [ %70, %cond_exit_443.i ] - %70 = add nuw nsw i64 %"393_0.sroa.15.0.i963", 1 - %71 = lshr i64 %"393_0.sroa.15.0.i963", 6 +69: ; preds = %__barray_mask_return.exit868, %cond_exit_443.i + %"393_0.sroa.15.0.i957" = phi i64 [ 0, %__barray_mask_return.exit868 ], [ %70, %cond_exit_443.i ] + %70 = add nuw nsw i64 %"393_0.sroa.15.0.i957", 1 + %71 = lshr i64 %"393_0.sroa.15.0.i957", 6 %72 = getelementptr inbounds i64, i64* %11, i64 %71 %73 = load i64, i64* %72, align 4 - %74 = shl nuw nsw i64 1, %"393_0.sroa.15.0.i963" + %74 = shl nuw nsw i64 1, %"393_0.sroa.15.0.i957" %75 = and i64 %73, %74 %.not.i99.i.i = icmp eq i64 %75, 0 br i1 %.not.i99.i.i, label %__barray_check_bounds.exit.i, label %panic.i.i.i @@ -241,7 +241,7 @@ panic.i.i.i: ; preds = %69 __barray_check_bounds.exit.i: ; preds = %69 %76 = xor i64 %73, %74 store i64 %76, i64* %72, align 4 - %77 = getelementptr inbounds i64, i64* %9, i64 %"393_0.sroa.15.0.i963" + %77 = getelementptr inbounds i64, i64* %9, i64 %"393_0.sroa.15.0.i957" %78 = load i64, i64* %77, align 4 %lazy_measure.i = tail call i64 @___lazy_measure(i64 %78) tail call void @___qfree(i64 %78) @@ -259,10 +259,10 @@ cond_exit_443.i: ; preds = %__barray_check_boun %"457_054.fca.1.insert.i" = insertvalue { i1, i64, i1 } { i1 true, i64 poison, i1 poison }, i64 %lazy_measure.i, 1 %82 = xor i64 %80, %74 store i64 %82, i64* %79, align 4 - %83 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %57, i64 %"393_0.sroa.15.0.i963" + %83 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %57, i64 %"393_0.sroa.15.0.i957" store { i1, i64, i1 } %"457_054.fca.1.insert.i", { i1, i64, i1 }* %83, align 4 - %exitcond979.not = icmp eq i64 %70, 10 - br i1 %exitcond979.not, label %mask_block_ok.i.i.i, label %69 + %exitcond973.not = icmp eq i64 %70, 10 + br i1 %exitcond973.not, label %mask_block_ok.i.i.i, label %69 __barray_check_none_borrowed.exit: ; preds = %"__hugr__.$measure_array$$n(10).367.exit" %84 = tail call i8* @heap_alloc(i64 240) @@ -277,78 +277,78 @@ mask_block_err.i: ; preds = %"__hugr__.$measure_ tail call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable -89: ; preds = %__barray_check_none_borrowed.exit, %__hugr__.const_fun_290.309.exit - %storemerge850968 = phi i64 [ 0, %__barray_check_none_borrowed.exit ], [ %107, %__hugr__.const_fun_290.309.exit ] - %90 = phi i64 [ 0, %__barray_check_none_borrowed.exit ], [ %105, %__hugr__.const_fun_290.309.exit ] - %91 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %57, i64 %storemerge850968 +89: ; preds = %__barray_check_none_borrowed.exit, %__hugr__.const_fun_338.322.exit + %storemerge844962 = phi i64 [ 0, %__barray_check_none_borrowed.exit ], [ %107, %__hugr__.const_fun_338.322.exit ] + %90 = phi i64 [ 0, %__barray_check_none_borrowed.exit ], [ %105, %__hugr__.const_fun_338.322.exit ] + %91 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %57, i64 %storemerge844962 %92 = load { i1, i64, i1 }, { i1, i64, i1 }* %91, align 4 %.fca.0.extract118.i = extractvalue { i1, i64, i1 } %92, 0 %.fca.1.extract119.i = extractvalue { i1, i64, i1 } %92, 1 - br i1 %.fca.0.extract118.i, label %cond_525_case_1.i, label %cond_exit_525.i + br i1 %.fca.0.extract118.i, label %cond_513_case_1.i, label %cond_exit_513.i -cond_525_case_1.i: ; preds = %89 +cond_513_case_1.i: ; preds = %89 tail call void @___inc_future_refcount(i64 %.fca.1.extract119.i) %93 = insertvalue { i1, i64, i1 } { i1 true, i64 poison, i1 poison }, i64 %.fca.1.extract119.i, 1 - br label %cond_exit_525.i + br label %cond_exit_513.i -cond_exit_525.i: ; preds = %cond_525_case_1.i, %89 - %.pn.i = phi { i1, i64, i1 } [ %93, %cond_525_case_1.i ], [ %92, %89 ] +cond_exit_513.i: ; preds = %cond_513_case_1.i, %89 + %.pn.i = phi { i1, i64, i1 } [ %93, %cond_513_case_1.i ], [ %92, %89 ] %"04.sroa.6.0.i" = extractvalue { i1, i64, i1 } %.pn.i, 2 %94 = icmp ult i64 %90, 10 - br i1 %94, label %95, label %cond_528_case_0.i + br i1 %94, label %95, label %cond_516_case_0.i -95: ; preds = %cond_exit_525.i +95: ; preds = %cond_exit_513.i %96 = lshr i64 %90, 6 %97 = getelementptr inbounds i64, i64* %65, i64 %96 %98 = load i64, i64* %97, align 4 %99 = shl nuw nsw i64 1, %90 %100 = and i64 %98, %99 - %.not.i.i876 = icmp eq i64 %100, 0 - br i1 %.not.i.i876, label %cond_528_case_1.i, label %panic.i.i877 + %.not.i.i870 = icmp eq i64 %100, 0 + br i1 %.not.i.i870, label %cond_516_case_1.i, label %panic.i.i871 -panic.i.i877: ; preds = %95 +panic.i.i871: ; preds = %95 tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable -cond_528_case_0.i: ; preds = %cond_exit_525.i +cond_516_case_0.i: ; preds = %cond_exit_513.i tail call void @panic(i32 1001, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @"e_Expected v.E6312129.0", i64 0, i64 0)) unreachable -cond_528_case_1.i: ; preds = %95 +cond_516_case_1.i: ; preds = %95 %"17.fca.2.insert.i" = insertvalue { i1, i64, i1 } %92, i1 %"04.sroa.6.0.i", 2 %101 = insertvalue { i1, { i1, i64, i1 } } { i1 true, { i1, i64, i1 } poison }, { i1, i64, i1 } %"17.fca.2.insert.i", 1 %102 = getelementptr inbounds { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %88, i64 %90 %103 = getelementptr inbounds { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %102, i64 0, i32 0 %104 = load i1, i1* %103, align 1 store { i1, { i1, i64, i1 } } %101, { i1, { i1, i64, i1 } }* %102, align 4 - br i1 %104, label %cond_529_case_1.i, label %__hugr__.const_fun_290.309.exit + br i1 %104, label %cond_517_case_1.i, label %__hugr__.const_fun_338.322.exit -cond_529_case_1.i: ; preds = %cond_528_case_1.i +cond_517_case_1.i: ; preds = %cond_516_case_1.i tail call void @panic(i32 1001, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @"e_Expected v.2F17E0A9.0", i64 0, i64 0)) unreachable -__hugr__.const_fun_290.309.exit: ; preds = %cond_528_case_1.i +__hugr__.const_fun_338.322.exit: ; preds = %cond_516_case_1.i %105 = add nuw nsw i64 %90, 1 - %106 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %85, i64 %storemerge850968 + %106 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %85, i64 %storemerge844962 store { i1, i64, i1 } %"17.fca.2.insert.i", { i1, i64, i1 }* %106, align 4 - %107 = add nuw nsw i64 %storemerge850968, 1 - %exitcond980.not = icmp eq i64 %107, 10 - br i1 %exitcond980.not, label %mask_block_ok.i881, label %89 + %107 = add nuw nsw i64 %storemerge844962, 1 + %exitcond974.not = icmp eq i64 %107, 10 + br i1 %exitcond974.not, label %mask_block_ok.i875, label %89 -mask_block_ok.i881: ; preds = %__hugr__.const_fun_290.309.exit +mask_block_ok.i875: ; preds = %__hugr__.const_fun_338.322.exit tail call void @heap_free(i8* nonnull %56) tail call void @heap_free(i8* %58) %108 = load i64, i64* %65, align 4 %109 = and i64 %108, 1023 store i64 %109, i64* %65, align 4 %110 = icmp eq i64 %109, 0 - br i1 %110, label %__barray_check_none_borrowed.exit883, label %mask_block_err.i882 + br i1 %110, label %__barray_check_none_borrowed.exit877, label %mask_block_err.i876 -mask_block_err.i882: ; preds = %mask_block_ok.i881 +mask_block_err.i876: ; preds = %mask_block_ok.i875 tail call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable -__barray_check_none_borrowed.exit883: ; preds = %mask_block_ok.i881 +__barray_check_none_borrowed.exit877: ; preds = %mask_block_ok.i875 %111 = tail call i8* @heap_alloc(i64 240) %112 = bitcast i8* %111 to { i1, i64, i1 }* %113 = tail call i8* @heap_alloc(i64 8) @@ -356,22 +356,22 @@ __barray_check_none_borrowed.exit883: ; preds = %mask_block_ok.i881 store i64 0, i64* %114, align 1 %115 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %88, align 4 %.fca.0.extract11.i = extractvalue { i1, { i1, i64, i1 } } %115, 0 - br i1 %.fca.0.extract11.i, label %__hugr__.const_fun_284.290.exit, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i, label %__hugr__.const_fun_287.338.exit, label %cond_558_case_0.i -cond_570_case_0.i: ; preds = %__hugr__.const_fun_284.290.exit.8, %__hugr__.const_fun_284.290.exit.7, %__hugr__.const_fun_284.290.exit.6, %__hugr__.const_fun_284.290.exit.5, %__hugr__.const_fun_284.290.exit.4, %__hugr__.const_fun_284.290.exit.3, %__hugr__.const_fun_284.290.exit.2, %__hugr__.const_fun_284.290.exit.1, %__hugr__.const_fun_284.290.exit, %__barray_check_none_borrowed.exit883 +cond_558_case_0.i: ; preds = %__hugr__.const_fun_287.338.exit.8, %__hugr__.const_fun_287.338.exit.7, %__hugr__.const_fun_287.338.exit.6, %__hugr__.const_fun_287.338.exit.5, %__hugr__.const_fun_287.338.exit.4, %__hugr__.const_fun_287.338.exit.3, %__hugr__.const_fun_287.338.exit.2, %__hugr__.const_fun_287.338.exit.1, %__hugr__.const_fun_287.338.exit, %__barray_check_none_borrowed.exit877 tail call void @panic(i32 1001, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @"e_Expected v.E6312129.0", i64 0, i64 0)) unreachable -__hugr__.const_fun_284.290.exit: ; preds = %__barray_check_none_borrowed.exit883 +__hugr__.const_fun_287.338.exit: ; preds = %__barray_check_none_borrowed.exit877 %116 = extractvalue { i1, { i1, i64, i1 } } %115, 1 store { i1, i64, i1 } %116, { i1, i64, i1 }* %112, align 4 %117 = getelementptr inbounds i8, i8* %63, i64 32 %118 = bitcast i8* %117 to { i1, { i1, i64, i1 } }* %119 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %118, align 4 %.fca.0.extract11.i.1 = extractvalue { i1, { i1, i64, i1 } } %119, 0 - br i1 %.fca.0.extract11.i.1, label %__hugr__.const_fun_284.290.exit.1, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.1, label %__hugr__.const_fun_287.338.exit.1, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.1: ; preds = %__hugr__.const_fun_284.290.exit +__hugr__.const_fun_287.338.exit.1: ; preds = %__hugr__.const_fun_287.338.exit %120 = extractvalue { i1, { i1, i64, i1 } } %119, 1 %121 = getelementptr inbounds i8, i8* %111, i64 24 %122 = bitcast i8* %121 to { i1, i64, i1 }* @@ -380,9 +380,9 @@ __hugr__.const_fun_284.290.exit.1: ; preds = %__hugr__.const_fun_ %124 = bitcast i8* %123 to { i1, { i1, i64, i1 } }* %125 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %124, align 4 %.fca.0.extract11.i.2 = extractvalue { i1, { i1, i64, i1 } } %125, 0 - br i1 %.fca.0.extract11.i.2, label %__hugr__.const_fun_284.290.exit.2, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.2, label %__hugr__.const_fun_287.338.exit.2, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.2: ; preds = %__hugr__.const_fun_284.290.exit.1 +__hugr__.const_fun_287.338.exit.2: ; preds = %__hugr__.const_fun_287.338.exit.1 %126 = extractvalue { i1, { i1, i64, i1 } } %125, 1 %127 = getelementptr inbounds i8, i8* %111, i64 48 %128 = bitcast i8* %127 to { i1, i64, i1 }* @@ -391,9 +391,9 @@ __hugr__.const_fun_284.290.exit.2: ; preds = %__hugr__.const_fun_ %130 = bitcast i8* %129 to { i1, { i1, i64, i1 } }* %131 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %130, align 4 %.fca.0.extract11.i.3 = extractvalue { i1, { i1, i64, i1 } } %131, 0 - br i1 %.fca.0.extract11.i.3, label %__hugr__.const_fun_284.290.exit.3, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.3, label %__hugr__.const_fun_287.338.exit.3, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.3: ; preds = %__hugr__.const_fun_284.290.exit.2 +__hugr__.const_fun_287.338.exit.3: ; preds = %__hugr__.const_fun_287.338.exit.2 %132 = extractvalue { i1, { i1, i64, i1 } } %131, 1 %133 = getelementptr inbounds i8, i8* %111, i64 72 %134 = bitcast i8* %133 to { i1, i64, i1 }* @@ -402,9 +402,9 @@ __hugr__.const_fun_284.290.exit.3: ; preds = %__hugr__.const_fun_ %136 = bitcast i8* %135 to { i1, { i1, i64, i1 } }* %137 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %136, align 4 %.fca.0.extract11.i.4 = extractvalue { i1, { i1, i64, i1 } } %137, 0 - br i1 %.fca.0.extract11.i.4, label %__hugr__.const_fun_284.290.exit.4, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.4, label %__hugr__.const_fun_287.338.exit.4, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.4: ; preds = %__hugr__.const_fun_284.290.exit.3 +__hugr__.const_fun_287.338.exit.4: ; preds = %__hugr__.const_fun_287.338.exit.3 %138 = extractvalue { i1, { i1, i64, i1 } } %137, 1 %139 = getelementptr inbounds i8, i8* %111, i64 96 %140 = bitcast i8* %139 to { i1, i64, i1 }* @@ -413,9 +413,9 @@ __hugr__.const_fun_284.290.exit.4: ; preds = %__hugr__.const_fun_ %142 = bitcast i8* %141 to { i1, { i1, i64, i1 } }* %143 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %142, align 4 %.fca.0.extract11.i.5 = extractvalue { i1, { i1, i64, i1 } } %143, 0 - br i1 %.fca.0.extract11.i.5, label %__hugr__.const_fun_284.290.exit.5, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.5, label %__hugr__.const_fun_287.338.exit.5, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.5: ; preds = %__hugr__.const_fun_284.290.exit.4 +__hugr__.const_fun_287.338.exit.5: ; preds = %__hugr__.const_fun_287.338.exit.4 %144 = extractvalue { i1, { i1, i64, i1 } } %143, 1 %145 = getelementptr inbounds i8, i8* %111, i64 120 %146 = bitcast i8* %145 to { i1, i64, i1 }* @@ -424,9 +424,9 @@ __hugr__.const_fun_284.290.exit.5: ; preds = %__hugr__.const_fun_ %148 = bitcast i8* %147 to { i1, { i1, i64, i1 } }* %149 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %148, align 4 %.fca.0.extract11.i.6 = extractvalue { i1, { i1, i64, i1 } } %149, 0 - br i1 %.fca.0.extract11.i.6, label %__hugr__.const_fun_284.290.exit.6, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.6, label %__hugr__.const_fun_287.338.exit.6, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.6: ; preds = %__hugr__.const_fun_284.290.exit.5 +__hugr__.const_fun_287.338.exit.6: ; preds = %__hugr__.const_fun_287.338.exit.5 %150 = extractvalue { i1, { i1, i64, i1 } } %149, 1 %151 = getelementptr inbounds i8, i8* %111, i64 144 %152 = bitcast i8* %151 to { i1, i64, i1 }* @@ -435,9 +435,9 @@ __hugr__.const_fun_284.290.exit.6: ; preds = %__hugr__.const_fun_ %154 = bitcast i8* %153 to { i1, { i1, i64, i1 } }* %155 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %154, align 4 %.fca.0.extract11.i.7 = extractvalue { i1, { i1, i64, i1 } } %155, 0 - br i1 %.fca.0.extract11.i.7, label %__hugr__.const_fun_284.290.exit.7, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.7, label %__hugr__.const_fun_287.338.exit.7, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.7: ; preds = %__hugr__.const_fun_284.290.exit.6 +__hugr__.const_fun_287.338.exit.7: ; preds = %__hugr__.const_fun_287.338.exit.6 %156 = extractvalue { i1, { i1, i64, i1 } } %155, 1 %157 = getelementptr inbounds i8, i8* %111, i64 168 %158 = bitcast i8* %157 to { i1, i64, i1 }* @@ -446,9 +446,9 @@ __hugr__.const_fun_284.290.exit.7: ; preds = %__hugr__.const_fun_ %160 = bitcast i8* %159 to { i1, { i1, i64, i1 } }* %161 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %160, align 4 %.fca.0.extract11.i.8 = extractvalue { i1, { i1, i64, i1 } } %161, 0 - br i1 %.fca.0.extract11.i.8, label %__hugr__.const_fun_284.290.exit.8, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.8, label %__hugr__.const_fun_287.338.exit.8, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.8: ; preds = %__hugr__.const_fun_284.290.exit.7 +__hugr__.const_fun_287.338.exit.8: ; preds = %__hugr__.const_fun_287.338.exit.7 %162 = extractvalue { i1, { i1, i64, i1 } } %161, 1 %163 = getelementptr inbounds i8, i8* %111, i64 192 %164 = bitcast i8* %163 to { i1, i64, i1 }* @@ -457,86 +457,86 @@ __hugr__.const_fun_284.290.exit.8: ; preds = %__hugr__.const_fun_ %166 = bitcast i8* %165 to { i1, { i1, i64, i1 } }* %167 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %166, align 4 %.fca.0.extract11.i.9 = extractvalue { i1, { i1, i64, i1 } } %167, 0 - br i1 %.fca.0.extract11.i.9, label %__hugr__.const_fun_284.290.exit.9, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.9, label %__hugr__.const_fun_287.338.exit.9, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.9: ; preds = %__hugr__.const_fun_284.290.exit.8 +__hugr__.const_fun_287.338.exit.9: ; preds = %__hugr__.const_fun_287.338.exit.8 %168 = extractvalue { i1, { i1, i64, i1 } } %167, 1 %169 = getelementptr inbounds i8, i8* %111, i64 216 %170 = bitcast i8* %169 to { i1, i64, i1 }* store { i1, i64, i1 } %168, { i1, i64, i1 }* %170, align 4 tail call void @heap_free(i8* nonnull %63) tail call void @heap_free(i8* nonnull %64) - br label %__barray_check_bounds.exit888 + br label %__barray_check_bounds.exit882 -cond_165_case_0: ; preds = %cond_exit_165 +cond_169_case_0: ; preds = %cond_exit_169 %171 = load i64, i64* %114, align 4 %172 = or i64 %171, -1024 store i64 %172, i64* %114, align 4 %173 = icmp eq i64 %172, -1 - br i1 %173, label %loop_out139, label %mask_block_err.i886 + br i1 %173, label %loop_out135, label %mask_block_err.i880 -mask_block_err.i886: ; preds = %cond_165_case_0 +mask_block_err.i880: ; preds = %cond_169_case_0 tail call void @panic(i32 1002, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @"e_Array cont.EFA5AC45.0", i64 0, i64 0)) unreachable -__barray_check_bounds.exit888: ; preds = %__hugr__.const_fun_284.290.exit.9, %cond_exit_165 - %"167_0.0989" = phi i64 [ 0, %__hugr__.const_fun_284.290.exit.9 ], [ %174, %cond_exit_165 ] - %174 = add nuw nsw i64 %"167_0.0989", 1 - %175 = lshr i64 %"167_0.0989", 6 +__barray_check_bounds.exit882: ; preds = %__hugr__.const_fun_287.338.exit.9, %cond_exit_169 + %"172_0.0983" = phi i64 [ 0, %__hugr__.const_fun_287.338.exit.9 ], [ %174, %cond_exit_169 ] + %174 = add nuw nsw i64 %"172_0.0983", 1 + %175 = lshr i64 %"172_0.0983", 6 %176 = getelementptr inbounds i64, i64* %114, i64 %175 %177 = load i64, i64* %176, align 4 - %178 = shl nuw nsw i64 1, %"167_0.0989" + %178 = shl nuw nsw i64 1, %"172_0.0983" %179 = and i64 %177, %178 %.not = icmp eq i64 %179, 0 - br i1 %.not, label %__barray_mask_borrow.exit893, label %cond_exit_165 + br i1 %.not, label %__barray_mask_borrow.exit887, label %cond_exit_169 -__barray_mask_borrow.exit893: ; preds = %__barray_check_bounds.exit888 +__barray_mask_borrow.exit887: ; preds = %__barray_check_bounds.exit882 %180 = xor i64 %177, %178 store i64 %180, i64* %176, align 4 - %181 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %112, i64 %"167_0.0989" + %181 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %112, i64 %"172_0.0983" %182 = load { i1, i64, i1 }, { i1, i64, i1 }* %181, align 4 - %.fca.0.extract511 = extractvalue { i1, i64, i1 } %182, 0 - br i1 %.fca.0.extract511, label %cond_501_case_1, label %cond_exit_165 + %.fca.0.extract505 = extractvalue { i1, i64, i1 } %182, 0 + br i1 %.fca.0.extract505, label %cond_496_case_1, label %cond_exit_169 -cond_exit_165: ; preds = %cond_501_case_1, %__barray_mask_borrow.exit893, %__barray_check_bounds.exit888 - %183 = icmp ult i64 %"167_0.0989", 9 - br i1 %183, label %__barray_check_bounds.exit888, label %cond_165_case_0 +cond_exit_169: ; preds = %cond_496_case_1, %__barray_mask_borrow.exit887, %__barray_check_bounds.exit882 + %183 = icmp ult i64 %"172_0.0983", 9 + br i1 %183, label %__barray_check_bounds.exit882, label %cond_169_case_0 -loop_out139: ; preds = %cond_165_case_0 +loop_out135: ; preds = %cond_169_case_0 tail call void @heap_free(i8* %111) tail call void @heap_free(i8* nonnull %113) %184 = load i64, i64* %87, align 4 %185 = and i64 %184, 1023 store i64 %185, i64* %87, align 4 %186 = icmp eq i64 %185, 0 - br i1 %186, label %__barray_check_none_borrowed.exit898, label %mask_block_err.i897 + br i1 %186, label %__barray_check_none_borrowed.exit892, label %mask_block_err.i891 -__barray_check_none_borrowed.exit898: ; preds = %loop_out139 +__barray_check_none_borrowed.exit892: ; preds = %loop_out135 %187 = tail call i8* @heap_alloc(i64 10) %188 = tail call i8* @heap_alloc(i64 8) %189 = bitcast i8* %188 to i64* store i64 0, i64* %189, align 1 %190 = load { i1, i64, i1 }, { i1, i64, i1 }* %85, align 4 - %.fca.0.extract.i899 = extractvalue { i1, i64, i1 } %190, 0 - %.fca.1.extract.i900 = extractvalue { i1, i64, i1 } %190, 1 - br i1 %.fca.0.extract.i899, label %cond_300_case_1.i, label %cond_300_case_0.i + %.fca.0.extract.i893 = extractvalue { i1, i64, i1 } %190, 0 + %.fca.1.extract.i894 = extractvalue { i1, i64, i1 } %190, 1 + br i1 %.fca.0.extract.i893, label %cond_300_case_1.i, label %cond_300_case_0.i -mask_block_err.i897: ; preds = %loop_out139 +mask_block_err.i891: ; preds = %loop_out135 tail call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable -cond_501_case_1: ; preds = %__barray_mask_borrow.exit893 - %.fca.1.extract512 = extractvalue { i1, i64, i1 } %182, 1 - tail call void @___dec_future_refcount(i64 %.fca.1.extract512) - br label %cond_exit_165 +cond_496_case_1: ; preds = %__barray_mask_borrow.exit887 + %.fca.1.extract506 = extractvalue { i1, i64, i1 } %182, 1 + tail call void @___dec_future_refcount(i64 %.fca.1.extract506) + br label %cond_exit_169 -cond_300_case_0.i: ; preds = %__barray_check_none_borrowed.exit898 +cond_300_case_0.i: ; preds = %__barray_check_none_borrowed.exit892 %.fca.2.extract.i = extractvalue { i1, i64, i1 } %190, 2 br label %__hugr__.array.__read_bool.3.271.exit -cond_300_case_1.i: ; preds = %__barray_check_none_borrowed.exit898 - %read_bool.i = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900) +cond_300_case_1.i: ; preds = %__barray_check_none_borrowed.exit892 + %read_bool.i = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894) br label %__hugr__.array.__read_bool.3.271.exit __hugr__.array.__read_bool.3.271.exit: ; preds = %cond_300_case_0.i, %cond_300_case_1.i @@ -546,17 +546,17 @@ __hugr__.array.__read_bool.3.271.exit: ; preds = %cond_300_case_0.i, %192 = getelementptr inbounds i8, i8* %84, i64 24 %193 = bitcast i8* %192 to { i1, i64, i1 }* %194 = load { i1, i64, i1 }, { i1, i64, i1 }* %193, align 4 - %.fca.0.extract.i899.1 = extractvalue { i1, i64, i1 } %194, 0 - %.fca.1.extract.i900.1 = extractvalue { i1, i64, i1 } %194, 1 - br i1 %.fca.0.extract.i899.1, label %cond_300_case_1.i.1, label %cond_300_case_0.i.1 + %.fca.0.extract.i893.1 = extractvalue { i1, i64, i1 } %194, 0 + %.fca.1.extract.i894.1 = extractvalue { i1, i64, i1 } %194, 1 + br i1 %.fca.0.extract.i893.1, label %cond_300_case_1.i.1, label %cond_300_case_0.i.1 cond_300_case_0.i.1: ; preds = %__hugr__.array.__read_bool.3.271.exit %.fca.2.extract.i.1 = extractvalue { i1, i64, i1 } %194, 2 br label %__hugr__.array.__read_bool.3.271.exit.1 cond_300_case_1.i.1: ; preds = %__hugr__.array.__read_bool.3.271.exit - %read_bool.i.1 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.1) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.1) + %read_bool.i.1 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.1) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.1) br label %__hugr__.array.__read_bool.3.271.exit.1 __hugr__.array.__read_bool.3.271.exit.1: ; preds = %cond_300_case_1.i.1, %cond_300_case_0.i.1 @@ -567,17 +567,17 @@ __hugr__.array.__read_bool.3.271.exit.1: ; preds = %cond_300_case_1.i.1 %197 = getelementptr inbounds i8, i8* %84, i64 48 %198 = bitcast i8* %197 to { i1, i64, i1 }* %199 = load { i1, i64, i1 }, { i1, i64, i1 }* %198, align 4 - %.fca.0.extract.i899.2 = extractvalue { i1, i64, i1 } %199, 0 - %.fca.1.extract.i900.2 = extractvalue { i1, i64, i1 } %199, 1 - br i1 %.fca.0.extract.i899.2, label %cond_300_case_1.i.2, label %cond_300_case_0.i.2 + %.fca.0.extract.i893.2 = extractvalue { i1, i64, i1 } %199, 0 + %.fca.1.extract.i894.2 = extractvalue { i1, i64, i1 } %199, 1 + br i1 %.fca.0.extract.i893.2, label %cond_300_case_1.i.2, label %cond_300_case_0.i.2 cond_300_case_0.i.2: ; preds = %__hugr__.array.__read_bool.3.271.exit.1 %.fca.2.extract.i.2 = extractvalue { i1, i64, i1 } %199, 2 br label %__hugr__.array.__read_bool.3.271.exit.2 cond_300_case_1.i.2: ; preds = %__hugr__.array.__read_bool.3.271.exit.1 - %read_bool.i.2 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.2) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.2) + %read_bool.i.2 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.2) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.2) br label %__hugr__.array.__read_bool.3.271.exit.2 __hugr__.array.__read_bool.3.271.exit.2: ; preds = %cond_300_case_1.i.2, %cond_300_case_0.i.2 @@ -588,17 +588,17 @@ __hugr__.array.__read_bool.3.271.exit.2: ; preds = %cond_300_case_1.i.2 %202 = getelementptr inbounds i8, i8* %84, i64 72 %203 = bitcast i8* %202 to { i1, i64, i1 }* %204 = load { i1, i64, i1 }, { i1, i64, i1 }* %203, align 4 - %.fca.0.extract.i899.3 = extractvalue { i1, i64, i1 } %204, 0 - %.fca.1.extract.i900.3 = extractvalue { i1, i64, i1 } %204, 1 - br i1 %.fca.0.extract.i899.3, label %cond_300_case_1.i.3, label %cond_300_case_0.i.3 + %.fca.0.extract.i893.3 = extractvalue { i1, i64, i1 } %204, 0 + %.fca.1.extract.i894.3 = extractvalue { i1, i64, i1 } %204, 1 + br i1 %.fca.0.extract.i893.3, label %cond_300_case_1.i.3, label %cond_300_case_0.i.3 cond_300_case_0.i.3: ; preds = %__hugr__.array.__read_bool.3.271.exit.2 %.fca.2.extract.i.3 = extractvalue { i1, i64, i1 } %204, 2 br label %__hugr__.array.__read_bool.3.271.exit.3 cond_300_case_1.i.3: ; preds = %__hugr__.array.__read_bool.3.271.exit.2 - %read_bool.i.3 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.3) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.3) + %read_bool.i.3 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.3) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.3) br label %__hugr__.array.__read_bool.3.271.exit.3 __hugr__.array.__read_bool.3.271.exit.3: ; preds = %cond_300_case_1.i.3, %cond_300_case_0.i.3 @@ -609,17 +609,17 @@ __hugr__.array.__read_bool.3.271.exit.3: ; preds = %cond_300_case_1.i.3 %207 = getelementptr inbounds i8, i8* %84, i64 96 %208 = bitcast i8* %207 to { i1, i64, i1 }* %209 = load { i1, i64, i1 }, { i1, i64, i1 }* %208, align 4 - %.fca.0.extract.i899.4 = extractvalue { i1, i64, i1 } %209, 0 - %.fca.1.extract.i900.4 = extractvalue { i1, i64, i1 } %209, 1 - br i1 %.fca.0.extract.i899.4, label %cond_300_case_1.i.4, label %cond_300_case_0.i.4 + %.fca.0.extract.i893.4 = extractvalue { i1, i64, i1 } %209, 0 + %.fca.1.extract.i894.4 = extractvalue { i1, i64, i1 } %209, 1 + br i1 %.fca.0.extract.i893.4, label %cond_300_case_1.i.4, label %cond_300_case_0.i.4 cond_300_case_0.i.4: ; preds = %__hugr__.array.__read_bool.3.271.exit.3 %.fca.2.extract.i.4 = extractvalue { i1, i64, i1 } %209, 2 br label %__hugr__.array.__read_bool.3.271.exit.4 cond_300_case_1.i.4: ; preds = %__hugr__.array.__read_bool.3.271.exit.3 - %read_bool.i.4 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.4) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.4) + %read_bool.i.4 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.4) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.4) br label %__hugr__.array.__read_bool.3.271.exit.4 __hugr__.array.__read_bool.3.271.exit.4: ; preds = %cond_300_case_1.i.4, %cond_300_case_0.i.4 @@ -630,17 +630,17 @@ __hugr__.array.__read_bool.3.271.exit.4: ; preds = %cond_300_case_1.i.4 %212 = getelementptr inbounds i8, i8* %84, i64 120 %213 = bitcast i8* %212 to { i1, i64, i1 }* %214 = load { i1, i64, i1 }, { i1, i64, i1 }* %213, align 4 - %.fca.0.extract.i899.5 = extractvalue { i1, i64, i1 } %214, 0 - %.fca.1.extract.i900.5 = extractvalue { i1, i64, i1 } %214, 1 - br i1 %.fca.0.extract.i899.5, label %cond_300_case_1.i.5, label %cond_300_case_0.i.5 + %.fca.0.extract.i893.5 = extractvalue { i1, i64, i1 } %214, 0 + %.fca.1.extract.i894.5 = extractvalue { i1, i64, i1 } %214, 1 + br i1 %.fca.0.extract.i893.5, label %cond_300_case_1.i.5, label %cond_300_case_0.i.5 cond_300_case_0.i.5: ; preds = %__hugr__.array.__read_bool.3.271.exit.4 %.fca.2.extract.i.5 = extractvalue { i1, i64, i1 } %214, 2 br label %__hugr__.array.__read_bool.3.271.exit.5 cond_300_case_1.i.5: ; preds = %__hugr__.array.__read_bool.3.271.exit.4 - %read_bool.i.5 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.5) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.5) + %read_bool.i.5 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.5) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.5) br label %__hugr__.array.__read_bool.3.271.exit.5 __hugr__.array.__read_bool.3.271.exit.5: ; preds = %cond_300_case_1.i.5, %cond_300_case_0.i.5 @@ -651,17 +651,17 @@ __hugr__.array.__read_bool.3.271.exit.5: ; preds = %cond_300_case_1.i.5 %217 = getelementptr inbounds i8, i8* %84, i64 144 %218 = bitcast i8* %217 to { i1, i64, i1 }* %219 = load { i1, i64, i1 }, { i1, i64, i1 }* %218, align 4 - %.fca.0.extract.i899.6 = extractvalue { i1, i64, i1 } %219, 0 - %.fca.1.extract.i900.6 = extractvalue { i1, i64, i1 } %219, 1 - br i1 %.fca.0.extract.i899.6, label %cond_300_case_1.i.6, label %cond_300_case_0.i.6 + %.fca.0.extract.i893.6 = extractvalue { i1, i64, i1 } %219, 0 + %.fca.1.extract.i894.6 = extractvalue { i1, i64, i1 } %219, 1 + br i1 %.fca.0.extract.i893.6, label %cond_300_case_1.i.6, label %cond_300_case_0.i.6 cond_300_case_0.i.6: ; preds = %__hugr__.array.__read_bool.3.271.exit.5 %.fca.2.extract.i.6 = extractvalue { i1, i64, i1 } %219, 2 br label %__hugr__.array.__read_bool.3.271.exit.6 cond_300_case_1.i.6: ; preds = %__hugr__.array.__read_bool.3.271.exit.5 - %read_bool.i.6 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.6) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.6) + %read_bool.i.6 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.6) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.6) br label %__hugr__.array.__read_bool.3.271.exit.6 __hugr__.array.__read_bool.3.271.exit.6: ; preds = %cond_300_case_1.i.6, %cond_300_case_0.i.6 @@ -672,17 +672,17 @@ __hugr__.array.__read_bool.3.271.exit.6: ; preds = %cond_300_case_1.i.6 %222 = getelementptr inbounds i8, i8* %84, i64 168 %223 = bitcast i8* %222 to { i1, i64, i1 }* %224 = load { i1, i64, i1 }, { i1, i64, i1 }* %223, align 4 - %.fca.0.extract.i899.7 = extractvalue { i1, i64, i1 } %224, 0 - %.fca.1.extract.i900.7 = extractvalue { i1, i64, i1 } %224, 1 - br i1 %.fca.0.extract.i899.7, label %cond_300_case_1.i.7, label %cond_300_case_0.i.7 + %.fca.0.extract.i893.7 = extractvalue { i1, i64, i1 } %224, 0 + %.fca.1.extract.i894.7 = extractvalue { i1, i64, i1 } %224, 1 + br i1 %.fca.0.extract.i893.7, label %cond_300_case_1.i.7, label %cond_300_case_0.i.7 cond_300_case_0.i.7: ; preds = %__hugr__.array.__read_bool.3.271.exit.6 %.fca.2.extract.i.7 = extractvalue { i1, i64, i1 } %224, 2 br label %__hugr__.array.__read_bool.3.271.exit.7 cond_300_case_1.i.7: ; preds = %__hugr__.array.__read_bool.3.271.exit.6 - %read_bool.i.7 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.7) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.7) + %read_bool.i.7 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.7) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.7) br label %__hugr__.array.__read_bool.3.271.exit.7 __hugr__.array.__read_bool.3.271.exit.7: ; preds = %cond_300_case_1.i.7, %cond_300_case_0.i.7 @@ -693,17 +693,17 @@ __hugr__.array.__read_bool.3.271.exit.7: ; preds = %cond_300_case_1.i.7 %227 = getelementptr inbounds i8, i8* %84, i64 192 %228 = bitcast i8* %227 to { i1, i64, i1 }* %229 = load { i1, i64, i1 }, { i1, i64, i1 }* %228, align 4 - %.fca.0.extract.i899.8 = extractvalue { i1, i64, i1 } %229, 0 - %.fca.1.extract.i900.8 = extractvalue { i1, i64, i1 } %229, 1 - br i1 %.fca.0.extract.i899.8, label %cond_300_case_1.i.8, label %cond_300_case_0.i.8 + %.fca.0.extract.i893.8 = extractvalue { i1, i64, i1 } %229, 0 + %.fca.1.extract.i894.8 = extractvalue { i1, i64, i1 } %229, 1 + br i1 %.fca.0.extract.i893.8, label %cond_300_case_1.i.8, label %cond_300_case_0.i.8 cond_300_case_0.i.8: ; preds = %__hugr__.array.__read_bool.3.271.exit.7 %.fca.2.extract.i.8 = extractvalue { i1, i64, i1 } %229, 2 br label %__hugr__.array.__read_bool.3.271.exit.8 cond_300_case_1.i.8: ; preds = %__hugr__.array.__read_bool.3.271.exit.7 - %read_bool.i.8 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.8) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.8) + %read_bool.i.8 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.8) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.8) br label %__hugr__.array.__read_bool.3.271.exit.8 __hugr__.array.__read_bool.3.271.exit.8: ; preds = %cond_300_case_1.i.8, %cond_300_case_0.i.8 @@ -714,17 +714,17 @@ __hugr__.array.__read_bool.3.271.exit.8: ; preds = %cond_300_case_1.i.8 %232 = getelementptr inbounds i8, i8* %84, i64 216 %233 = bitcast i8* %232 to { i1, i64, i1 }* %234 = load { i1, i64, i1 }, { i1, i64, i1 }* %233, align 4 - %.fca.0.extract.i899.9 = extractvalue { i1, i64, i1 } %234, 0 - %.fca.1.extract.i900.9 = extractvalue { i1, i64, i1 } %234, 1 - br i1 %.fca.0.extract.i899.9, label %cond_300_case_1.i.9, label %cond_300_case_0.i.9 + %.fca.0.extract.i893.9 = extractvalue { i1, i64, i1 } %234, 0 + %.fca.1.extract.i894.9 = extractvalue { i1, i64, i1 } %234, 1 + br i1 %.fca.0.extract.i893.9, label %cond_300_case_1.i.9, label %cond_300_case_0.i.9 cond_300_case_0.i.9: ; preds = %__hugr__.array.__read_bool.3.271.exit.8 %.fca.2.extract.i.9 = extractvalue { i1, i64, i1 } %234, 2 br label %__hugr__.array.__read_bool.3.271.exit.9 cond_300_case_1.i.9: ; preds = %__hugr__.array.__read_bool.3.271.exit.8 - %read_bool.i.9 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.9) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.9) + %read_bool.i.9 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.9) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.9) br label %__hugr__.array.__read_bool.3.271.exit.9 __hugr__.array.__read_bool.3.271.exit.9: ; preds = %cond_300_case_1.i.9, %cond_300_case_0.i.9 @@ -738,9 +738,9 @@ __hugr__.array.__read_bool.3.271.exit.9: ; preds = %cond_300_case_1.i.9 %238 = and i64 %237, 1023 store i64 %238, i64* %189, align 4 %239 = icmp eq i64 %238, 0 - br i1 %239, label %__barray_check_none_borrowed.exit905, label %mask_block_err.i904 + br i1 %239, label %__barray_check_none_borrowed.exit899, label %mask_block_err.i898 -__barray_check_none_borrowed.exit905: ; preds = %__hugr__.array.__read_bool.3.271.exit.9 +__barray_check_none_borrowed.exit899: ; preds = %__hugr__.array.__read_bool.3.271.exit.9 %out_arr_alloca = alloca <{ i32, i32, i1*, i1* }>, align 8 %x_ptr = getelementptr inbounds <{ i32, i32, i1*, i1* }>, <{ i32, i32, i1*, i1* }>* %out_arr_alloca, i64 0, i32 0 %y_ptr = getelementptr inbounds <{ i32, i32, i1*, i1* }>, <{ i32, i32, i1*, i1* }>* %out_arr_alloca, i64 0, i32 1 @@ -756,52 +756,52 @@ __barray_check_none_borrowed.exit905: ; preds = %__hugr__.array.__re store i8* %187, i8** %242, align 8 store i1* %.sub, i1** %mask_ptr, align 8 call void @print_bool_arr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @res_cs.46C3C4B5.0, i64 0, i64 0), i64 15, <{ i32, i32, i1*, i1* }>* nonnull %out_arr_alloca) - br label %__barray_check_bounds.exit913 + br label %__barray_check_bounds.exit907 -mask_block_err.i904: ; preds = %__hugr__.array.__read_bool.3.271.exit.9 +mask_block_err.i898: ; preds = %__hugr__.array.__read_bool.3.271.exit.9 tail call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable -__barray_check_bounds.exit913: ; preds = %cond_exit_95.1, %__barray_check_none_borrowed.exit905 - %"90_0.sroa.0.0972" = phi i64 [ 0, %__barray_check_none_borrowed.exit905 ], [ %252, %cond_exit_95.1 ] - %243 = or i64 %"90_0.sroa.0.0972", 1 - %244 = lshr i64 %"90_0.sroa.0.0972", 6 +__barray_check_bounds.exit907: ; preds = %cond_exit_95.1, %__barray_check_none_borrowed.exit899 + %"90_0.sroa.0.0966" = phi i64 [ 0, %__barray_check_none_borrowed.exit899 ], [ %252, %cond_exit_95.1 ] + %243 = or i64 %"90_0.sroa.0.0966", 1 + %244 = lshr i64 %"90_0.sroa.0.0966", 6 %245 = getelementptr inbounds i64, i64* %7, i64 %244 %246 = load i64, i64* %245, align 4 - %247 = and i64 %"90_0.sroa.0.0972", 62 + %247 = and i64 %"90_0.sroa.0.0966", 62 %248 = shl nuw i64 1, %247 %249 = and i64 %246, %248 - %.not.i914 = icmp eq i64 %249, 0 - br i1 %.not.i914, label %panic.i915, label %cond_exit_95 + %.not.i908 = icmp eq i64 %249, 0 + br i1 %.not.i908, label %panic.i909, label %cond_exit_95 -panic.i915: ; preds = %cond_exit_95, %__barray_check_bounds.exit913 +panic.i909: ; preds = %cond_exit_95, %__barray_check_bounds.exit907 call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -cond_exit_95: ; preds = %__barray_check_bounds.exit913 +cond_exit_95: ; preds = %__barray_check_bounds.exit907 %250 = xor i64 %246, %248 store i64 %250, i64* %245, align 4 - %251 = getelementptr inbounds i64, i64* %5, i64 %"90_0.sroa.0.0972" - store i64 %"90_0.sroa.0.0972", i64* %251, align 4 - %252 = add nuw nsw i64 %"90_0.sroa.0.0972", 2 - %253 = lshr i64 %"90_0.sroa.0.0972", 6 + %251 = getelementptr inbounds i64, i64* %5, i64 %"90_0.sroa.0.0966" + store i64 %"90_0.sroa.0.0966", i64* %251, align 4 + %252 = add nuw nsw i64 %"90_0.sroa.0.0966", 2 + %253 = lshr i64 %"90_0.sroa.0.0966", 6 %254 = getelementptr inbounds i64, i64* %7, i64 %253 %255 = load i64, i64* %254, align 4 %256 = and i64 %243, 63 %257 = shl nuw i64 1, %256 %258 = and i64 %255, %257 - %.not.i914.1 = icmp eq i64 %258, 0 - br i1 %.not.i914.1, label %panic.i915, label %cond_exit_95.1 + %.not.i908.1 = icmp eq i64 %258, 0 + br i1 %.not.i908.1, label %panic.i909, label %cond_exit_95.1 cond_exit_95.1: ; preds = %cond_exit_95 %259 = xor i64 %255, %257 store i64 %259, i64* %254, align 4 %260 = getelementptr inbounds i64, i64* %5, i64 %243 store i64 %243, i64* %260, align 4 - %exitcond983.not.1 = icmp eq i64 %252, 100 - br i1 %exitcond983.not.1, label %loop_out212, label %__barray_check_bounds.exit913 + %exitcond977.not.1 = icmp eq i64 %252, 100 + br i1 %exitcond977.not.1, label %loop_out208, label %__barray_check_bounds.exit907 -loop_out212: ; preds = %cond_exit_95.1 +loop_out208: ; preds = %cond_exit_95.1 %261 = getelementptr inbounds i8, i8* %6, i64 8 %262 = bitcast i8* %261 to i64* %263 = load i64, i64* %262, align 4 @@ -811,9 +811,9 @@ loop_out212: ; preds = %cond_exit_95.1 %266 = icmp eq i64 %265, 0 %267 = icmp eq i64 %264, 0 %or.cond = select i1 %266, i1 %267, i1 false - br i1 %or.cond, label %__barray_check_none_borrowed.exit921, label %mask_block_err.i920 + br i1 %or.cond, label %__barray_check_none_borrowed.exit915, label %mask_block_err.i914 -__barray_check_none_borrowed.exit921: ; preds = %loop_out212 +__barray_check_none_borrowed.exit915: ; preds = %loop_out208 %268 = call i8* @heap_alloc(i64 800) %269 = bitcast i8* %268 to i64* %270 = call i8* @heap_alloc(i64 16) @@ -827,62 +827,62 @@ __barray_check_none_borrowed.exit921: ; preds = %loop_out212 %274 = load i64, i64* %7, align 4 %275 = icmp eq i64 %274, 0 %276 = icmp eq i64 %273, 0 - %or.cond986 = select i1 %275, i1 %276, i1 false - br i1 %or.cond986, label %__barray_check_none_borrowed.exit926, label %mask_block_err.i925 + %or.cond980 = select i1 %275, i1 %276, i1 false + br i1 %or.cond980, label %__barray_check_none_borrowed.exit920, label %mask_block_err.i919 -mask_block_err.i920: ; preds = %loop_out212 +mask_block_err.i914: ; preds = %loop_out208 call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable -__barray_check_none_borrowed.exit926: ; preds = %__barray_check_none_borrowed.exit921 - %out_arr_alloca287 = alloca <{ i32, i32, i64*, i1* }>, align 8 - %x_ptr288 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca287, i64 0, i32 0 - %y_ptr289 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca287, i64 0, i32 1 - %arr_ptr290 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca287, i64 0, i32 2 - %mask_ptr291 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca287, i64 0, i32 3 +__barray_check_none_borrowed.exit920: ; preds = %__barray_check_none_borrowed.exit915 + %out_arr_alloca282 = alloca <{ i32, i32, i64*, i1* }>, align 8 + %x_ptr283 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca282, i64 0, i32 0 + %y_ptr284 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca282, i64 0, i32 1 + %arr_ptr285 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca282, i64 0, i32 2 + %mask_ptr286 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca282, i64 0, i32 3 %277 = alloca [100 x i1], align 1 - %.sub635 = getelementptr inbounds [100 x i1], [100 x i1]* %277, i64 0, i64 0 + %.sub629 = getelementptr inbounds [100 x i1], [100 x i1]* %277, i64 0, i64 0 %278 = bitcast [100 x i1]* %277 to i8* call void @llvm.memset.p0i8.i64(i8* noundef nonnull align 1 dereferenceable(100) %278, i8 0, i64 100, i1 false) - store i32 100, i32* %x_ptr288, align 8 - store i32 1, i32* %y_ptr289, align 4 - %279 = bitcast i64** %arr_ptr290 to i8** + store i32 100, i32* %x_ptr283, align 8 + store i32 1, i32* %y_ptr284, align 4 + %279 = bitcast i64** %arr_ptr285 to i8** store i8* %4, i8** %279, align 8 - store i1* %.sub635, i1** %mask_ptr291, align 8 - call void @print_int_arr(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @res_is.F21393DB.0, i64 0, i64 0), i64 14, <{ i32, i32, i64*, i1* }>* nonnull %out_arr_alloca287) - br label %__barray_check_bounds.exit934 + store i1* %.sub629, i1** %mask_ptr286, align 8 + call void @print_int_arr(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @res_is.F21393DB.0, i64 0, i64 0), i64 14, <{ i32, i32, i64*, i1* }>* nonnull %out_arr_alloca282) + br label %__barray_check_bounds.exit928 -mask_block_err.i925: ; preds = %__barray_check_none_borrowed.exit921 +mask_block_err.i919: ; preds = %__barray_check_none_borrowed.exit915 call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable -__barray_check_bounds.exit934: ; preds = %cond_exit_130, %__barray_check_none_borrowed.exit926 - %"125_0.sroa.0.0974" = phi i64 [ 0, %__barray_check_none_borrowed.exit926 ], [ %280, %cond_exit_130 ] - %280 = add nuw nsw i64 %"125_0.sroa.0.0974", 1 - %281 = lshr i64 %"125_0.sroa.0.0974", 6 +__barray_check_bounds.exit928: ; preds = %cond_exit_130, %__barray_check_none_borrowed.exit920 + %"125_0.sroa.0.0968" = phi i64 [ 0, %__barray_check_none_borrowed.exit920 ], [ %280, %cond_exit_130 ] + %280 = add nuw nsw i64 %"125_0.sroa.0.0968", 1 + %281 = lshr i64 %"125_0.sroa.0.0968", 6 %282 = getelementptr inbounds i64, i64* %3, i64 %281 %283 = load i64, i64* %282, align 4 - %284 = and i64 %"125_0.sroa.0.0974", 63 + %284 = and i64 %"125_0.sroa.0.0968", 63 %285 = shl nuw i64 1, %284 %286 = and i64 %283, %285 - %.not.i935 = icmp eq i64 %286, 0 - br i1 %.not.i935, label %panic.i936, label %cond_exit_130 + %.not.i929 = icmp eq i64 %286, 0 + br i1 %.not.i929, label %panic.i930, label %cond_exit_130 -panic.i936: ; preds = %__barray_check_bounds.exit934 +panic.i930: ; preds = %__barray_check_bounds.exit928 call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -cond_exit_130: ; preds = %__barray_check_bounds.exit934 - %287 = sitofp i64 %"125_0.sroa.0.0974" to double +cond_exit_130: ; preds = %__barray_check_bounds.exit928 + %287 = sitofp i64 %"125_0.sroa.0.0968" to double %288 = fmul double %287, 6.250000e-02 %289 = xor i64 %283, %285 store i64 %289, i64* %282, align 4 - %290 = getelementptr inbounds double, double* %1, i64 %"125_0.sroa.0.0974" + %290 = getelementptr inbounds double, double* %1, i64 %"125_0.sroa.0.0968" store double %288, double* %290, align 8 - %exitcond984.not = icmp eq i64 %280, 100 - br i1 %exitcond984.not, label %loop_out299, label %__barray_check_bounds.exit934 + %exitcond978.not = icmp eq i64 %280, 100 + br i1 %exitcond978.not, label %loop_out294, label %__barray_check_bounds.exit928 -loop_out299: ; preds = %cond_exit_130 +loop_out294: ; preds = %cond_exit_130 %291 = getelementptr inbounds i8, i8* %2, i64 8 %292 = bitcast i8* %291 to i64* %293 = load i64, i64* %292, align 4 @@ -891,10 +891,10 @@ loop_out299: ; preds = %cond_exit_130 %295 = load i64, i64* %3, align 4 %296 = icmp eq i64 %295, 0 %297 = icmp eq i64 %294, 0 - %or.cond987 = select i1 %296, i1 %297, i1 false - br i1 %or.cond987, label %__barray_check_none_borrowed.exit942, label %mask_block_err.i941 + %or.cond981 = select i1 %296, i1 %297, i1 false + br i1 %or.cond981, label %__barray_check_none_borrowed.exit936, label %mask_block_err.i935 -__barray_check_none_borrowed.exit942: ; preds = %loop_out299 +__barray_check_none_borrowed.exit936: ; preds = %loop_out294 %298 = call i8* @heap_alloc(i64 800) %299 = bitcast i8* %298 to double* %300 = call i8* @heap_alloc(i64 16) @@ -908,32 +908,32 @@ __barray_check_none_borrowed.exit942: ; preds = %loop_out299 %304 = load i64, i64* %3, align 4 %305 = icmp eq i64 %304, 0 %306 = icmp eq i64 %303, 0 - %or.cond988 = select i1 %305, i1 %306, i1 false - br i1 %or.cond988, label %__barray_check_none_borrowed.exit947, label %mask_block_err.i946 + %or.cond982 = select i1 %305, i1 %306, i1 false + br i1 %or.cond982, label %__barray_check_none_borrowed.exit941, label %mask_block_err.i940 -mask_block_err.i941: ; preds = %loop_out299 +mask_block_err.i935: ; preds = %loop_out294 call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable -__barray_check_none_borrowed.exit947: ; preds = %__barray_check_none_borrowed.exit942 - %out_arr_alloca377 = alloca <{ i32, i32, double*, i1* }>, align 8 - %x_ptr378 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca377, i64 0, i32 0 - %y_ptr379 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca377, i64 0, i32 1 - %arr_ptr380 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca377, i64 0, i32 2 - %mask_ptr381 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca377, i64 0, i32 3 +__barray_check_none_borrowed.exit941: ; preds = %__barray_check_none_borrowed.exit936 + %out_arr_alloca371 = alloca <{ i32, i32, double*, i1* }>, align 8 + %x_ptr372 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca371, i64 0, i32 0 + %y_ptr373 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca371, i64 0, i32 1 + %arr_ptr374 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca371, i64 0, i32 2 + %mask_ptr375 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca371, i64 0, i32 3 %307 = alloca [100 x i1], align 1 - %.sub736 = getelementptr inbounds [100 x i1], [100 x i1]* %307, i64 0, i64 0 + %.sub730 = getelementptr inbounds [100 x i1], [100 x i1]* %307, i64 0, i64 0 %308 = bitcast [100 x i1]* %307 to i8* call void @llvm.memset.p0i8.i64(i8* noundef nonnull align 1 dereferenceable(100) %308, i8 0, i64 100, i1 false) - store i32 100, i32* %x_ptr378, align 8 - store i32 1, i32* %y_ptr379, align 4 - %309 = bitcast double** %arr_ptr380 to i8** + store i32 100, i32* %x_ptr372, align 8 + store i32 1, i32* %y_ptr373, align 4 + %309 = bitcast double** %arr_ptr374 to i8** store i8* %0, i8** %309, align 8 - store i1* %.sub736, i1** %mask_ptr381, align 8 - call void @print_float_arr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @res_fs.CBD4AF54.0, i64 0, i64 0), i64 16, <{ i32, i32, double*, i1* }>* nonnull %out_arr_alloca377) + store i1* %.sub730, i1** %mask_ptr375, align 8 + call void @print_float_arr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @res_fs.CBD4AF54.0, i64 0, i64 0), i64 16, <{ i32, i32, double*, i1* }>* nonnull %out_arr_alloca371) ret void -mask_block_err.i946: ; preds = %__barray_check_none_borrowed.exit942 +mask_block_err.i940: ; preds = %__barray_check_none_borrowed.exit936 call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc index 48a0a576f..112e46c28 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc @@ -38,8 +38,8 @@ entry: br label %cond_20_case_1.i cond_20_case_1.i: ; preds = %cond_exit_20.i, %entry - %"15_0.sroa.0.0295.i" = phi i64 [ 0, %entry ], [ %5, %cond_exit_20.i ] - %5 = add nuw nsw i64 %"15_0.sroa.0.0295.i", 1 + %"15_0.sroa.0.0294.i" = phi i64 [ 0, %entry ], [ %5, %cond_exit_20.i ] + %5 = add nuw nsw i64 %"15_0.sroa.0.0294.i", 1 %qalloc.i.i = tail call i64 @___qalloc() %not_max.not.i.i = icmp eq i64 %qalloc.i.i, -1 br i1 %not_max.not.i.i, label %id_bb.i.i, label %reset_bb.i.i @@ -59,10 +59,10 @@ cond_217_case_0.i.i: ; preds = %id_bb.i.i unreachable __barray_check_bounds.exit.i: ; preds = %id_bb.i.i - %8 = lshr i64 %"15_0.sroa.0.0295.i", 6 + %8 = lshr i64 %"15_0.sroa.0.0294.i", 6 %9 = getelementptr inbounds i64, i64* %4, i64 %8 %10 = load i64, i64* %9, align 4 - %11 = shl nuw nsw i64 1, %"15_0.sroa.0.0295.i" + %11 = shl nuw nsw i64 1, %"15_0.sroa.0.0294.i" %12 = and i64 %10, %11 %.not.i.i = icmp eq i64 %12, 0 br i1 %.not.i.i, label %panic.i.i, label %cond_exit_20.i @@ -75,7 +75,7 @@ cond_exit_20.i: ; preds = %__barray_check_boun %.fca.1.extract.i.i = extractvalue { i1, i64 } %7, 1 %13 = xor i64 %10, %11 store i64 %13, i64* %9, align 4 - %14 = getelementptr inbounds i64, i64* %2, i64 %"15_0.sroa.0.0295.i" + %14 = getelementptr inbounds i64, i64* %2, i64 %"15_0.sroa.0.0294.i" store i64 %.fca.1.extract.i.i, i64* %14, align 4 %exitcond.not.i = icmp eq i64 %5, 10 br i1 %exitcond.not.i, label %loop_out.i, label %cond_20_case_1.i @@ -83,10 +83,10 @@ cond_exit_20.i: ; preds = %__barray_check_boun loop_out.i: ; preds = %cond_exit_20.i %15 = load i64, i64* %4, align 4 %16 = and i64 %15, 1 - %.not.i259.i = icmp eq i64 %16, 0 - br i1 %.not.i259.i, label %__barray_mask_borrow.exit.i, label %panic.i260.i + %.not.i258.i = icmp eq i64 %16, 0 + br i1 %.not.i258.i, label %__barray_mask_borrow.exit.i, label %panic.i259.i -panic.i260.i: ; preds = %loop_out.i +panic.i259.i: ; preds = %loop_out.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable @@ -97,27 +97,27 @@ __barray_mask_borrow.exit.i: ; preds = %loop_out.i tail call void @___rxy(i64 %18, double 0x400921FB54442D18, double 0.000000e+00) %19 = load i64, i64* %4, align 4 %20 = and i64 %19, 1 - %.not.i261.i = icmp eq i64 %20, 0 - br i1 %.not.i261.i, label %panic.i262.i, label %__barray_mask_return.exit263.i + %.not.i260.i = icmp eq i64 %20, 0 + br i1 %.not.i260.i, label %panic.i261.i, label %__barray_mask_return.exit262.i -panic.i262.i: ; preds = %__barray_mask_borrow.exit.i +panic.i261.i: ; preds = %__barray_mask_borrow.exit.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit263.i: ; preds = %__barray_mask_borrow.exit.i +__barray_mask_return.exit262.i: ; preds = %__barray_mask_borrow.exit.i %21 = xor i64 %19, 1 store i64 %21, i64* %4, align 4 store i64 %18, i64* %2, align 4 %22 = load i64, i64* %4, align 4 %23 = and i64 %22, 4 - %.not.i264.i = icmp eq i64 %23, 0 - br i1 %.not.i264.i, label %__barray_mask_borrow.exit266.i, label %panic.i265.i + %.not.i263.i = icmp eq i64 %23, 0 + br i1 %.not.i263.i, label %__barray_mask_borrow.exit265.i, label %panic.i264.i -panic.i265.i: ; preds = %__barray_mask_return.exit263.i +panic.i264.i: ; preds = %__barray_mask_return.exit262.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable -__barray_mask_borrow.exit266.i: ; preds = %__barray_mask_return.exit263.i +__barray_mask_borrow.exit265.i: ; preds = %__barray_mask_return.exit262.i %24 = xor i64 %22, 4 store i64 %24, i64* %4, align 4 %25 = getelementptr inbounds i8, i8* %1, i64 16 @@ -126,27 +126,27 @@ __barray_mask_borrow.exit266.i: ; preds = %__barray_mask_retur tail call void @___rxy(i64 %27, double 0x400921FB54442D18, double 0.000000e+00) %28 = load i64, i64* %4, align 4 %29 = and i64 %28, 4 - %.not.i267.i = icmp eq i64 %29, 0 - br i1 %.not.i267.i, label %panic.i268.i, label %__barray_mask_return.exit269.i + %.not.i266.i = icmp eq i64 %29, 0 + br i1 %.not.i266.i, label %panic.i267.i, label %__barray_mask_return.exit268.i -panic.i268.i: ; preds = %__barray_mask_borrow.exit266.i +panic.i267.i: ; preds = %__barray_mask_borrow.exit265.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit269.i: ; preds = %__barray_mask_borrow.exit266.i +__barray_mask_return.exit268.i: ; preds = %__barray_mask_borrow.exit265.i %30 = xor i64 %28, 4 store i64 %30, i64* %4, align 4 store i64 %27, i64* %26, align 4 %31 = load i64, i64* %4, align 4 %32 = and i64 %31, 8 - %.not.i270.i = icmp eq i64 %32, 0 - br i1 %.not.i270.i, label %__barray_mask_borrow.exit272.i, label %panic.i271.i + %.not.i269.i = icmp eq i64 %32, 0 + br i1 %.not.i269.i, label %__barray_mask_borrow.exit271.i, label %panic.i270.i -panic.i271.i: ; preds = %__barray_mask_return.exit269.i +panic.i270.i: ; preds = %__barray_mask_return.exit268.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable -__barray_mask_borrow.exit272.i: ; preds = %__barray_mask_return.exit269.i +__barray_mask_borrow.exit271.i: ; preds = %__barray_mask_return.exit268.i %33 = xor i64 %31, 8 store i64 %33, i64* %4, align 4 %34 = getelementptr inbounds i8, i8* %1, i64 24 @@ -155,27 +155,27 @@ __barray_mask_borrow.exit272.i: ; preds = %__barray_mask_retur tail call void @___rxy(i64 %36, double 0x400921FB54442D18, double 0.000000e+00) %37 = load i64, i64* %4, align 4 %38 = and i64 %37, 8 - %.not.i273.i = icmp eq i64 %38, 0 - br i1 %.not.i273.i, label %panic.i274.i, label %__barray_mask_return.exit275.i + %.not.i272.i = icmp eq i64 %38, 0 + br i1 %.not.i272.i, label %panic.i273.i, label %__barray_mask_return.exit274.i -panic.i274.i: ; preds = %__barray_mask_borrow.exit272.i +panic.i273.i: ; preds = %__barray_mask_borrow.exit271.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit275.i: ; preds = %__barray_mask_borrow.exit272.i +__barray_mask_return.exit274.i: ; preds = %__barray_mask_borrow.exit271.i %39 = xor i64 %37, 8 store i64 %39, i64* %4, align 4 store i64 %36, i64* %35, align 4 %40 = load i64, i64* %4, align 4 %41 = and i64 %40, 512 - %.not.i276.i = icmp eq i64 %41, 0 - br i1 %.not.i276.i, label %__barray_mask_borrow.exit278.i, label %panic.i277.i + %.not.i275.i = icmp eq i64 %41, 0 + br i1 %.not.i275.i, label %__barray_mask_borrow.exit277.i, label %panic.i276.i -panic.i277.i: ; preds = %__barray_mask_return.exit275.i +panic.i276.i: ; preds = %__barray_mask_return.exit274.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable -__barray_mask_borrow.exit278.i: ; preds = %__barray_mask_return.exit275.i +__barray_mask_borrow.exit277.i: ; preds = %__barray_mask_return.exit274.i %42 = xor i64 %40, 512 store i64 %42, i64* %4, align 4 %43 = getelementptr inbounds i8, i8* %1, i64 72 @@ -184,14 +184,14 @@ __barray_mask_borrow.exit278.i: ; preds = %__barray_mask_retur tail call void @___rxy(i64 %45, double 0x400921FB54442D18, double 0.000000e+00) %46 = load i64, i64* %4, align 4 %47 = and i64 %46, 512 - %.not.i279.i = icmp eq i64 %47, 0 - br i1 %.not.i279.i, label %panic.i280.i, label %__barray_mask_return.exit281.i + %.not.i278.i = icmp eq i64 %47, 0 + br i1 %.not.i278.i, label %panic.i279.i, label %__barray_mask_return.exit280.i -panic.i280.i: ; preds = %__barray_mask_borrow.exit278.i +panic.i279.i: ; preds = %__barray_mask_borrow.exit277.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit281.i: ; preds = %__barray_mask_borrow.exit278.i +__barray_mask_return.exit280.i: ; preds = %__barray_mask_borrow.exit277.i %48 = xor i64 %46, 512 store i64 %48, i64* %4, align 4 store i64 %45, i64* %44, align 4 @@ -212,19 +212,19 @@ mask_block_ok.i.i.i.i: ; preds = %cond_exit_353.i.i "__hugr__.$measure_array$$n(10).277.exit.i": ; preds = %mask_block_ok.i.i.i.i tail call void @heap_free(i8* nonnull %1) tail call void @heap_free(i8* nonnull %3) - br label %__barray_check_bounds.exit284.i + br label %__barray_check_bounds.exit283.i mask_block_err.i.i.i.i: ; preds = %mask_block_ok.i.i.i.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @"e_Array cont.EFA5AC45.0", i64 0, i64 0)) unreachable -56: ; preds = %cond_exit_353.i.i, %__barray_mask_return.exit281.i - %"303_0.sroa.15.0.i297.i" = phi i64 [ 0, %__barray_mask_return.exit281.i ], [ %57, %cond_exit_353.i.i ] - %57 = add nuw nsw i64 %"303_0.sroa.15.0.i297.i", 1 - %58 = lshr i64 %"303_0.sroa.15.0.i297.i", 6 +56: ; preds = %cond_exit_353.i.i, %__barray_mask_return.exit280.i + %"303_0.sroa.15.0.i296.i" = phi i64 [ 0, %__barray_mask_return.exit280.i ], [ %57, %cond_exit_353.i.i ] + %57 = add nuw nsw i64 %"303_0.sroa.15.0.i296.i", 1 + %58 = lshr i64 %"303_0.sroa.15.0.i296.i", 6 %59 = getelementptr inbounds i64, i64* %4, i64 %58 %60 = load i64, i64* %59, align 4 - %61 = shl nuw nsw i64 1, %"303_0.sroa.15.0.i297.i" + %61 = shl nuw nsw i64 1, %"303_0.sroa.15.0.i296.i" %62 = and i64 %60, %61 %.not.i99.i.i.i = icmp eq i64 %62, 0 br i1 %.not.i99.i.i.i, label %__barray_check_bounds.exit.i.i, label %panic.i.i.i.i @@ -236,7 +236,7 @@ panic.i.i.i.i: ; preds = %56 __barray_check_bounds.exit.i.i: ; preds = %56 %63 = xor i64 %60, %61 store i64 %63, i64* %59, align 4 - %64 = getelementptr inbounds i64, i64* %2, i64 %"303_0.sroa.15.0.i297.i" + %64 = getelementptr inbounds i64, i64* %2, i64 %"303_0.sroa.15.0.i296.i" %65 = load i64, i64* %64, align 4 %lazy_measure.i.i = tail call i64 @___lazy_measure(i64 %65) tail call void @___qfree(i64 %65) @@ -254,51 +254,51 @@ cond_exit_353.i.i: ; preds = %__barray_check_boun %"367_054.fca.1.insert.i.i" = insertvalue { i1, i64, i1 } { i1 true, i64 poison, i1 poison }, i64 %lazy_measure.i.i, 1 %69 = xor i64 %67, %61 store i64 %69, i64* %66, align 4 - %70 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %50, i64 %"303_0.sroa.15.0.i297.i" + %70 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %50, i64 %"303_0.sroa.15.0.i296.i" store { i1, i64, i1 } %"367_054.fca.1.insert.i.i", { i1, i64, i1 }* %70, align 4 - %exitcond298.not.i = icmp eq i64 %57, 10 - br i1 %exitcond298.not.i, label %mask_block_ok.i.i.i.i, label %56 + %exitcond297.not.i = icmp eq i64 %57, 10 + br i1 %exitcond297.not.i, label %mask_block_ok.i.i.i.i, label %56 -cond_160_case_0.i: ; preds = %cond_exit_160.i +cond_187_case_0.i: ; preds = %cond_exit_187.i %71 = load i64, i64* %52, align 4 %72 = or i64 %71, -1024 store i64 %72, i64* %52, align 4 %73 = icmp eq i64 %72, -1 br i1 %73, label %__hugr__.main.1.exit, label %mask_block_err.i.i -mask_block_err.i.i: ; preds = %cond_160_case_0.i +mask_block_err.i.i: ; preds = %cond_187_case_0.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @"e_Array cont.EFA5AC45.0", i64 0, i64 0)) unreachable -__barray_check_bounds.exit284.i: ; preds = %"__hugr__.$measure_array$$n(10).277.exit.i", %cond_exit_160.i - %"162_0.0.i1" = phi i64 [ 0, %"__hugr__.$measure_array$$n(10).277.exit.i" ], [ %82, %cond_exit_160.i ] - %74 = lshr i64 %"162_0.0.i1", 6 +__barray_check_bounds.exit283.i: ; preds = %"__hugr__.$measure_array$$n(10).277.exit.i", %cond_exit_187.i + %"164_0.0.i1" = phi i64 [ 0, %"__hugr__.$measure_array$$n(10).277.exit.i" ], [ %82, %cond_exit_187.i ] + %74 = lshr i64 %"164_0.0.i1", 6 %75 = getelementptr inbounds i64, i64* %52, i64 %74 %76 = load i64, i64* %75, align 4 - %77 = shl nuw nsw i64 1, %"162_0.0.i1" + %77 = shl nuw nsw i64 1, %"164_0.0.i1" %78 = and i64 %76, %77 %.not.i = icmp eq i64 %78, 0 - br i1 %.not.i, label %__barray_mask_borrow.exit289.i, label %cond_exit_160.i + br i1 %.not.i, label %__barray_mask_borrow.exit288.i, label %cond_exit_187.i -__barray_mask_borrow.exit289.i: ; preds = %__barray_check_bounds.exit284.i +__barray_mask_borrow.exit288.i: ; preds = %__barray_check_bounds.exit283.i %79 = xor i64 %76, %77 store i64 %79, i64* %75, align 4 - %80 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %50, i64 %"162_0.0.i1" + %80 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %50, i64 %"164_0.0.i1" %81 = load { i1, i64, i1 }, { i1, i64, i1 }* %80, align 4 - %.fca.0.extract180.i = extractvalue { i1, i64, i1 } %81, 0 - br i1 %.fca.0.extract180.i, label %cond_85_case_1.i, label %cond_exit_160.i + %.fca.0.extract179.i = extractvalue { i1, i64, i1 } %81, 0 + br i1 %.fca.0.extract179.i, label %cond_87_case_1.i, label %cond_exit_187.i -cond_exit_160.i: ; preds = %cond_85_case_1.i, %__barray_mask_borrow.exit289.i, %__barray_check_bounds.exit284.i - %82 = add nuw nsw i64 %"162_0.0.i1", 1 +cond_exit_187.i: ; preds = %cond_87_case_1.i, %__barray_mask_borrow.exit288.i, %__barray_check_bounds.exit283.i + %82 = add nuw nsw i64 %"164_0.0.i1", 1 %exitcond.not = icmp eq i64 %82, 10 - br i1 %exitcond.not, label %cond_160_case_0.i, label %__barray_check_bounds.exit284.i + br i1 %exitcond.not, label %cond_187_case_0.i, label %__barray_check_bounds.exit283.i -cond_85_case_1.i: ; preds = %__barray_mask_borrow.exit289.i +cond_87_case_1.i: ; preds = %__barray_mask_borrow.exit288.i %.fca.1.extract.i = extractvalue { i1, i64, i1 } %81, 1 tail call void @___dec_future_refcount(i64 %.fca.1.extract.i) - br label %cond_exit_160.i + br label %cond_exit_187.i -__hugr__.main.1.exit: ; preds = %cond_160_case_0.i +__hugr__.main.1.exit: ; preds = %cond_187_case_0.i tail call void @heap_free(i8* %49) tail call void @heap_free(i8* nonnull %51) %83 = tail call i64 @teardown() diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/x86_64-windows-msvc-print_array/print_array_x86_64-windows-msvc b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/x86_64-windows-msvc-print_array/print_array_x86_64-windows-msvc index c85dce449..61d861f1a 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/x86_64-windows-msvc-print_array/print_array_x86_64-windows-msvc +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/x86_64-windows-msvc-print_array/print_array_x86_64-windows-msvc @@ -34,8 +34,8 @@ alloca_block: br label %cond_20_case_1 cond_20_case_1: ; preds = %alloca_block, %cond_exit_20 - %"15_0.sroa.0.0961" = phi i64 [ 0, %alloca_block ], [ %12, %cond_exit_20 ] - %12 = add nuw nsw i64 %"15_0.sroa.0.0961", 1 + %"15_0.sroa.0.0955" = phi i64 [ 0, %alloca_block ], [ %12, %cond_exit_20 ] + %12 = add nuw nsw i64 %"15_0.sroa.0.0955", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.i = icmp eq i64 %qalloc.i, -1 br i1 %not_max.not.i, label %id_bb.i, label %reset_bb.i @@ -55,10 +55,10 @@ cond_303_case_0.i: ; preds = %id_bb.i unreachable __barray_check_bounds.exit: ; preds = %id_bb.i - %15 = lshr i64 %"15_0.sroa.0.0961", 6 + %15 = lshr i64 %"15_0.sroa.0.0955", 6 %16 = getelementptr inbounds i64, i64* %11, i64 %15 %17 = load i64, i64* %16, align 4 - %18 = shl nuw nsw i64 1, %"15_0.sroa.0.0961" + %18 = shl nuw nsw i64 1, %"15_0.sroa.0.0955" %19 = and i64 %17, %18 %.not.i = icmp eq i64 %19, 0 br i1 %.not.i, label %panic.i, label %cond_exit_20 @@ -71,7 +71,7 @@ cond_exit_20: ; preds = %__barray_check_boun %.fca.1.extract.i = extractvalue { i1, i64 } %14, 1 %20 = xor i64 %17, %18 store i64 %20, i64* %16, align 4 - %21 = getelementptr inbounds i64, i64* %9, i64 %"15_0.sroa.0.0961" + %21 = getelementptr inbounds i64, i64* %9, i64 %"15_0.sroa.0.0955" store i64 %.fca.1.extract.i, i64* %21, align 4 %exitcond.not = icmp eq i64 %12, 10 br i1 %exitcond.not, label %loop_out, label %cond_20_case_1 @@ -79,10 +79,10 @@ cond_exit_20: ; preds = %__barray_check_boun loop_out: ; preds = %cond_exit_20 %22 = load i64, i64* %11, align 4 %23 = and i64 %22, 1 - %.not.i852 = icmp eq i64 %23, 0 - br i1 %.not.i852, label %__barray_mask_borrow.exit, label %panic.i853 + %.not.i846 = icmp eq i64 %23, 0 + br i1 %.not.i846, label %__barray_mask_borrow.exit, label %panic.i847 -panic.i853: ; preds = %loop_out +panic.i847: ; preds = %loop_out tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable @@ -93,27 +93,27 @@ __barray_mask_borrow.exit: ; preds = %loop_out tail call void @___rxy(i64 %25, double 0x400921FB54442D18, double 0.000000e+00) %26 = load i64, i64* %11, align 4 %27 = and i64 %26, 1 - %.not.i854 = icmp eq i64 %27, 0 - br i1 %.not.i854, label %panic.i855, label %__barray_mask_return.exit856 + %.not.i848 = icmp eq i64 %27, 0 + br i1 %.not.i848, label %panic.i849, label %__barray_mask_return.exit850 -panic.i855: ; preds = %__barray_mask_borrow.exit +panic.i849: ; preds = %__barray_mask_borrow.exit tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit856: ; preds = %__barray_mask_borrow.exit +__barray_mask_return.exit850: ; preds = %__barray_mask_borrow.exit %28 = xor i64 %26, 1 store i64 %28, i64* %11, align 4 store i64 %25, i64* %9, align 4 %29 = load i64, i64* %11, align 4 %30 = and i64 %29, 4 - %.not.i857 = icmp eq i64 %30, 0 - br i1 %.not.i857, label %__barray_mask_borrow.exit859, label %panic.i858 + %.not.i851 = icmp eq i64 %30, 0 + br i1 %.not.i851, label %__barray_mask_borrow.exit853, label %panic.i852 -panic.i858: ; preds = %__barray_mask_return.exit856 +panic.i852: ; preds = %__barray_mask_return.exit850 tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable -__barray_mask_borrow.exit859: ; preds = %__barray_mask_return.exit856 +__barray_mask_borrow.exit853: ; preds = %__barray_mask_return.exit850 %31 = xor i64 %29, 4 store i64 %31, i64* %11, align 4 %32 = getelementptr inbounds i8, i8* %8, i64 16 @@ -122,27 +122,27 @@ __barray_mask_borrow.exit859: ; preds = %__barray_mask_retur tail call void @___rxy(i64 %34, double 0x400921FB54442D18, double 0.000000e+00) %35 = load i64, i64* %11, align 4 %36 = and i64 %35, 4 - %.not.i860 = icmp eq i64 %36, 0 - br i1 %.not.i860, label %panic.i861, label %__barray_mask_return.exit862 + %.not.i854 = icmp eq i64 %36, 0 + br i1 %.not.i854, label %panic.i855, label %__barray_mask_return.exit856 -panic.i861: ; preds = %__barray_mask_borrow.exit859 +panic.i855: ; preds = %__barray_mask_borrow.exit853 tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit862: ; preds = %__barray_mask_borrow.exit859 +__barray_mask_return.exit856: ; preds = %__barray_mask_borrow.exit853 %37 = xor i64 %35, 4 store i64 %37, i64* %11, align 4 store i64 %34, i64* %33, align 4 %38 = load i64, i64* %11, align 4 %39 = and i64 %38, 8 - %.not.i863 = icmp eq i64 %39, 0 - br i1 %.not.i863, label %__barray_mask_borrow.exit865, label %panic.i864 + %.not.i857 = icmp eq i64 %39, 0 + br i1 %.not.i857, label %__barray_mask_borrow.exit859, label %panic.i858 -panic.i864: ; preds = %__barray_mask_return.exit862 +panic.i858: ; preds = %__barray_mask_return.exit856 tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable -__barray_mask_borrow.exit865: ; preds = %__barray_mask_return.exit862 +__barray_mask_borrow.exit859: ; preds = %__barray_mask_return.exit856 %40 = xor i64 %38, 8 store i64 %40, i64* %11, align 4 %41 = getelementptr inbounds i8, i8* %8, i64 24 @@ -151,27 +151,27 @@ __barray_mask_borrow.exit865: ; preds = %__barray_mask_retur tail call void @___rxy(i64 %43, double 0x400921FB54442D18, double 0.000000e+00) %44 = load i64, i64* %11, align 4 %45 = and i64 %44, 8 - %.not.i866 = icmp eq i64 %45, 0 - br i1 %.not.i866, label %panic.i867, label %__barray_mask_return.exit868 + %.not.i860 = icmp eq i64 %45, 0 + br i1 %.not.i860, label %panic.i861, label %__barray_mask_return.exit862 -panic.i867: ; preds = %__barray_mask_borrow.exit865 +panic.i861: ; preds = %__barray_mask_borrow.exit859 tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit868: ; preds = %__barray_mask_borrow.exit865 +__barray_mask_return.exit862: ; preds = %__barray_mask_borrow.exit859 %46 = xor i64 %44, 8 store i64 %46, i64* %11, align 4 store i64 %43, i64* %42, align 4 %47 = load i64, i64* %11, align 4 %48 = and i64 %47, 512 - %.not.i869 = icmp eq i64 %48, 0 - br i1 %.not.i869, label %__barray_mask_borrow.exit871, label %panic.i870 + %.not.i863 = icmp eq i64 %48, 0 + br i1 %.not.i863, label %__barray_mask_borrow.exit865, label %panic.i864 -panic.i870: ; preds = %__barray_mask_return.exit868 +panic.i864: ; preds = %__barray_mask_return.exit862 tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable -__barray_mask_borrow.exit871: ; preds = %__barray_mask_return.exit868 +__barray_mask_borrow.exit865: ; preds = %__barray_mask_return.exit862 %49 = xor i64 %47, 512 store i64 %49, i64* %11, align 4 %50 = getelementptr inbounds i8, i8* %8, i64 72 @@ -180,14 +180,14 @@ __barray_mask_borrow.exit871: ; preds = %__barray_mask_retur tail call void @___rxy(i64 %52, double 0x400921FB54442D18, double 0.000000e+00) %53 = load i64, i64* %11, align 4 %54 = and i64 %53, 512 - %.not.i872 = icmp eq i64 %54, 0 - br i1 %.not.i872, label %panic.i873, label %__barray_mask_return.exit874 + %.not.i866 = icmp eq i64 %54, 0 + br i1 %.not.i866, label %panic.i867, label %__barray_mask_return.exit868 -panic.i873: ; preds = %__barray_mask_borrow.exit871 +panic.i867: ; preds = %__barray_mask_borrow.exit865 tail call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -__barray_mask_return.exit874: ; preds = %__barray_mask_borrow.exit871 +__barray_mask_return.exit868: ; preds = %__barray_mask_borrow.exit865 %55 = xor i64 %53, 512 store i64 %55, i64* %11, align 4 store i64 %52, i64* %51, align 4 @@ -223,13 +223,13 @@ mask_block_err.i.i.i: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @"e_Array cont.EFA5AC45.0", i64 0, i64 0)) unreachable -69: ; preds = %__barray_mask_return.exit874, %cond_exit_443.i - %"393_0.sroa.15.0.i963" = phi i64 [ 0, %__barray_mask_return.exit874 ], [ %70, %cond_exit_443.i ] - %70 = add nuw nsw i64 %"393_0.sroa.15.0.i963", 1 - %71 = lshr i64 %"393_0.sroa.15.0.i963", 6 +69: ; preds = %__barray_mask_return.exit868, %cond_exit_443.i + %"393_0.sroa.15.0.i957" = phi i64 [ 0, %__barray_mask_return.exit868 ], [ %70, %cond_exit_443.i ] + %70 = add nuw nsw i64 %"393_0.sroa.15.0.i957", 1 + %71 = lshr i64 %"393_0.sroa.15.0.i957", 6 %72 = getelementptr inbounds i64, i64* %11, i64 %71 %73 = load i64, i64* %72, align 4 - %74 = shl nuw nsw i64 1, %"393_0.sroa.15.0.i963" + %74 = shl nuw nsw i64 1, %"393_0.sroa.15.0.i957" %75 = and i64 %73, %74 %.not.i99.i.i = icmp eq i64 %75, 0 br i1 %.not.i99.i.i, label %__barray_check_bounds.exit.i, label %panic.i.i.i @@ -241,7 +241,7 @@ panic.i.i.i: ; preds = %69 __barray_check_bounds.exit.i: ; preds = %69 %76 = xor i64 %73, %74 store i64 %76, i64* %72, align 4 - %77 = getelementptr inbounds i64, i64* %9, i64 %"393_0.sroa.15.0.i963" + %77 = getelementptr inbounds i64, i64* %9, i64 %"393_0.sroa.15.0.i957" %78 = load i64, i64* %77, align 4 %lazy_measure.i = tail call i64 @___lazy_measure(i64 %78) tail call void @___qfree(i64 %78) @@ -259,10 +259,10 @@ cond_exit_443.i: ; preds = %__barray_check_boun %"457_054.fca.1.insert.i" = insertvalue { i1, i64, i1 } { i1 true, i64 poison, i1 poison }, i64 %lazy_measure.i, 1 %82 = xor i64 %80, %74 store i64 %82, i64* %79, align 4 - %83 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %57, i64 %"393_0.sroa.15.0.i963" + %83 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %57, i64 %"393_0.sroa.15.0.i957" store { i1, i64, i1 } %"457_054.fca.1.insert.i", { i1, i64, i1 }* %83, align 4 - %exitcond979.not = icmp eq i64 %70, 10 - br i1 %exitcond979.not, label %mask_block_ok.i.i.i, label %69 + %exitcond973.not = icmp eq i64 %70, 10 + br i1 %exitcond973.not, label %mask_block_ok.i.i.i, label %69 __barray_check_none_borrowed.exit: ; preds = %"__hugr__.$measure_array$$n(10).367.exit" %84 = tail call i8* @heap_alloc(i64 240) @@ -277,78 +277,78 @@ mask_block_err.i: ; preds = %"__hugr__.$measure_ tail call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable -89: ; preds = %__barray_check_none_borrowed.exit, %__hugr__.const_fun_290.309.exit - %storemerge850968 = phi i64 [ 0, %__barray_check_none_borrowed.exit ], [ %107, %__hugr__.const_fun_290.309.exit ] - %90 = phi i64 [ 0, %__barray_check_none_borrowed.exit ], [ %105, %__hugr__.const_fun_290.309.exit ] - %91 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %57, i64 %storemerge850968 +89: ; preds = %__barray_check_none_borrowed.exit, %__hugr__.const_fun_338.322.exit + %storemerge844962 = phi i64 [ 0, %__barray_check_none_borrowed.exit ], [ %107, %__hugr__.const_fun_338.322.exit ] + %90 = phi i64 [ 0, %__barray_check_none_borrowed.exit ], [ %105, %__hugr__.const_fun_338.322.exit ] + %91 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %57, i64 %storemerge844962 %92 = load { i1, i64, i1 }, { i1, i64, i1 }* %91, align 4 %.fca.0.extract118.i = extractvalue { i1, i64, i1 } %92, 0 %.fca.1.extract119.i = extractvalue { i1, i64, i1 } %92, 1 - br i1 %.fca.0.extract118.i, label %cond_525_case_1.i, label %cond_exit_525.i + br i1 %.fca.0.extract118.i, label %cond_513_case_1.i, label %cond_exit_513.i -cond_525_case_1.i: ; preds = %89 +cond_513_case_1.i: ; preds = %89 tail call void @___inc_future_refcount(i64 %.fca.1.extract119.i) %93 = insertvalue { i1, i64, i1 } { i1 true, i64 poison, i1 poison }, i64 %.fca.1.extract119.i, 1 - br label %cond_exit_525.i + br label %cond_exit_513.i -cond_exit_525.i: ; preds = %cond_525_case_1.i, %89 - %.pn.i = phi { i1, i64, i1 } [ %93, %cond_525_case_1.i ], [ %92, %89 ] +cond_exit_513.i: ; preds = %cond_513_case_1.i, %89 + %.pn.i = phi { i1, i64, i1 } [ %93, %cond_513_case_1.i ], [ %92, %89 ] %"04.sroa.6.0.i" = extractvalue { i1, i64, i1 } %.pn.i, 2 %94 = icmp ult i64 %90, 10 - br i1 %94, label %95, label %cond_528_case_0.i + br i1 %94, label %95, label %cond_516_case_0.i -95: ; preds = %cond_exit_525.i +95: ; preds = %cond_exit_513.i %96 = lshr i64 %90, 6 %97 = getelementptr inbounds i64, i64* %65, i64 %96 %98 = load i64, i64* %97, align 4 %99 = shl nuw nsw i64 1, %90 %100 = and i64 %98, %99 - %.not.i.i876 = icmp eq i64 %100, 0 - br i1 %.not.i.i876, label %cond_528_case_1.i, label %panic.i.i877 + %.not.i.i870 = icmp eq i64 %100, 0 + br i1 %.not.i.i870, label %cond_516_case_1.i, label %panic.i.i871 -panic.i.i877: ; preds = %95 +panic.i.i871: ; preds = %95 tail call void @panic(i32 1002, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"e_Array elem.E746B1A3.0", i64 0, i64 0)) unreachable -cond_528_case_0.i: ; preds = %cond_exit_525.i +cond_516_case_0.i: ; preds = %cond_exit_513.i tail call void @panic(i32 1001, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @"e_Expected v.E6312129.0", i64 0, i64 0)) unreachable -cond_528_case_1.i: ; preds = %95 +cond_516_case_1.i: ; preds = %95 %"17.fca.2.insert.i" = insertvalue { i1, i64, i1 } %92, i1 %"04.sroa.6.0.i", 2 %101 = insertvalue { i1, { i1, i64, i1 } } { i1 true, { i1, i64, i1 } poison }, { i1, i64, i1 } %"17.fca.2.insert.i", 1 %102 = getelementptr inbounds { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %88, i64 %90 %103 = getelementptr inbounds { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %102, i64 0, i32 0 %104 = load i1, i1* %103, align 1 store { i1, { i1, i64, i1 } } %101, { i1, { i1, i64, i1 } }* %102, align 4 - br i1 %104, label %cond_529_case_1.i, label %__hugr__.const_fun_290.309.exit + br i1 %104, label %cond_517_case_1.i, label %__hugr__.const_fun_338.322.exit -cond_529_case_1.i: ; preds = %cond_528_case_1.i +cond_517_case_1.i: ; preds = %cond_516_case_1.i tail call void @panic(i32 1001, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @"e_Expected v.2F17E0A9.0", i64 0, i64 0)) unreachable -__hugr__.const_fun_290.309.exit: ; preds = %cond_528_case_1.i +__hugr__.const_fun_338.322.exit: ; preds = %cond_516_case_1.i %105 = add nuw nsw i64 %90, 1 - %106 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %85, i64 %storemerge850968 + %106 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %85, i64 %storemerge844962 store { i1, i64, i1 } %"17.fca.2.insert.i", { i1, i64, i1 }* %106, align 4 - %107 = add nuw nsw i64 %storemerge850968, 1 - %exitcond980.not = icmp eq i64 %107, 10 - br i1 %exitcond980.not, label %mask_block_ok.i881, label %89 + %107 = add nuw nsw i64 %storemerge844962, 1 + %exitcond974.not = icmp eq i64 %107, 10 + br i1 %exitcond974.not, label %mask_block_ok.i875, label %89 -mask_block_ok.i881: ; preds = %__hugr__.const_fun_290.309.exit +mask_block_ok.i875: ; preds = %__hugr__.const_fun_338.322.exit tail call void @heap_free(i8* nonnull %56) tail call void @heap_free(i8* %58) %108 = load i64, i64* %65, align 4 %109 = and i64 %108, 1023 store i64 %109, i64* %65, align 4 %110 = icmp eq i64 %109, 0 - br i1 %110, label %__barray_check_none_borrowed.exit883, label %mask_block_err.i882 + br i1 %110, label %__barray_check_none_borrowed.exit877, label %mask_block_err.i876 -mask_block_err.i882: ; preds = %mask_block_ok.i881 +mask_block_err.i876: ; preds = %mask_block_ok.i875 tail call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable -__barray_check_none_borrowed.exit883: ; preds = %mask_block_ok.i881 +__barray_check_none_borrowed.exit877: ; preds = %mask_block_ok.i875 %111 = tail call i8* @heap_alloc(i64 240) %112 = bitcast i8* %111 to { i1, i64, i1 }* %113 = tail call i8* @heap_alloc(i64 8) @@ -356,22 +356,22 @@ __barray_check_none_borrowed.exit883: ; preds = %mask_block_ok.i881 store i64 0, i64* %114, align 1 %115 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %88, align 4 %.fca.0.extract11.i = extractvalue { i1, { i1, i64, i1 } } %115, 0 - br i1 %.fca.0.extract11.i, label %__hugr__.const_fun_284.290.exit, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i, label %__hugr__.const_fun_287.338.exit, label %cond_558_case_0.i -cond_570_case_0.i: ; preds = %__hugr__.const_fun_284.290.exit.8, %__hugr__.const_fun_284.290.exit.7, %__hugr__.const_fun_284.290.exit.6, %__hugr__.const_fun_284.290.exit.5, %__hugr__.const_fun_284.290.exit.4, %__hugr__.const_fun_284.290.exit.3, %__hugr__.const_fun_284.290.exit.2, %__hugr__.const_fun_284.290.exit.1, %__hugr__.const_fun_284.290.exit, %__barray_check_none_borrowed.exit883 +cond_558_case_0.i: ; preds = %__hugr__.const_fun_287.338.exit.8, %__hugr__.const_fun_287.338.exit.7, %__hugr__.const_fun_287.338.exit.6, %__hugr__.const_fun_287.338.exit.5, %__hugr__.const_fun_287.338.exit.4, %__hugr__.const_fun_287.338.exit.3, %__hugr__.const_fun_287.338.exit.2, %__hugr__.const_fun_287.338.exit.1, %__hugr__.const_fun_287.338.exit, %__barray_check_none_borrowed.exit877 tail call void @panic(i32 1001, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @"e_Expected v.E6312129.0", i64 0, i64 0)) unreachable -__hugr__.const_fun_284.290.exit: ; preds = %__barray_check_none_borrowed.exit883 +__hugr__.const_fun_287.338.exit: ; preds = %__barray_check_none_borrowed.exit877 %116 = extractvalue { i1, { i1, i64, i1 } } %115, 1 store { i1, i64, i1 } %116, { i1, i64, i1 }* %112, align 4 %117 = getelementptr inbounds i8, i8* %63, i64 32 %118 = bitcast i8* %117 to { i1, { i1, i64, i1 } }* %119 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %118, align 4 %.fca.0.extract11.i.1 = extractvalue { i1, { i1, i64, i1 } } %119, 0 - br i1 %.fca.0.extract11.i.1, label %__hugr__.const_fun_284.290.exit.1, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.1, label %__hugr__.const_fun_287.338.exit.1, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.1: ; preds = %__hugr__.const_fun_284.290.exit +__hugr__.const_fun_287.338.exit.1: ; preds = %__hugr__.const_fun_287.338.exit %120 = extractvalue { i1, { i1, i64, i1 } } %119, 1 %121 = getelementptr inbounds i8, i8* %111, i64 24 %122 = bitcast i8* %121 to { i1, i64, i1 }* @@ -380,9 +380,9 @@ __hugr__.const_fun_284.290.exit.1: ; preds = %__hugr__.const_fun_ %124 = bitcast i8* %123 to { i1, { i1, i64, i1 } }* %125 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %124, align 4 %.fca.0.extract11.i.2 = extractvalue { i1, { i1, i64, i1 } } %125, 0 - br i1 %.fca.0.extract11.i.2, label %__hugr__.const_fun_284.290.exit.2, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.2, label %__hugr__.const_fun_287.338.exit.2, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.2: ; preds = %__hugr__.const_fun_284.290.exit.1 +__hugr__.const_fun_287.338.exit.2: ; preds = %__hugr__.const_fun_287.338.exit.1 %126 = extractvalue { i1, { i1, i64, i1 } } %125, 1 %127 = getelementptr inbounds i8, i8* %111, i64 48 %128 = bitcast i8* %127 to { i1, i64, i1 }* @@ -391,9 +391,9 @@ __hugr__.const_fun_284.290.exit.2: ; preds = %__hugr__.const_fun_ %130 = bitcast i8* %129 to { i1, { i1, i64, i1 } }* %131 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %130, align 4 %.fca.0.extract11.i.3 = extractvalue { i1, { i1, i64, i1 } } %131, 0 - br i1 %.fca.0.extract11.i.3, label %__hugr__.const_fun_284.290.exit.3, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.3, label %__hugr__.const_fun_287.338.exit.3, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.3: ; preds = %__hugr__.const_fun_284.290.exit.2 +__hugr__.const_fun_287.338.exit.3: ; preds = %__hugr__.const_fun_287.338.exit.2 %132 = extractvalue { i1, { i1, i64, i1 } } %131, 1 %133 = getelementptr inbounds i8, i8* %111, i64 72 %134 = bitcast i8* %133 to { i1, i64, i1 }* @@ -402,9 +402,9 @@ __hugr__.const_fun_284.290.exit.3: ; preds = %__hugr__.const_fun_ %136 = bitcast i8* %135 to { i1, { i1, i64, i1 } }* %137 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %136, align 4 %.fca.0.extract11.i.4 = extractvalue { i1, { i1, i64, i1 } } %137, 0 - br i1 %.fca.0.extract11.i.4, label %__hugr__.const_fun_284.290.exit.4, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.4, label %__hugr__.const_fun_287.338.exit.4, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.4: ; preds = %__hugr__.const_fun_284.290.exit.3 +__hugr__.const_fun_287.338.exit.4: ; preds = %__hugr__.const_fun_287.338.exit.3 %138 = extractvalue { i1, { i1, i64, i1 } } %137, 1 %139 = getelementptr inbounds i8, i8* %111, i64 96 %140 = bitcast i8* %139 to { i1, i64, i1 }* @@ -413,9 +413,9 @@ __hugr__.const_fun_284.290.exit.4: ; preds = %__hugr__.const_fun_ %142 = bitcast i8* %141 to { i1, { i1, i64, i1 } }* %143 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %142, align 4 %.fca.0.extract11.i.5 = extractvalue { i1, { i1, i64, i1 } } %143, 0 - br i1 %.fca.0.extract11.i.5, label %__hugr__.const_fun_284.290.exit.5, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.5, label %__hugr__.const_fun_287.338.exit.5, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.5: ; preds = %__hugr__.const_fun_284.290.exit.4 +__hugr__.const_fun_287.338.exit.5: ; preds = %__hugr__.const_fun_287.338.exit.4 %144 = extractvalue { i1, { i1, i64, i1 } } %143, 1 %145 = getelementptr inbounds i8, i8* %111, i64 120 %146 = bitcast i8* %145 to { i1, i64, i1 }* @@ -424,9 +424,9 @@ __hugr__.const_fun_284.290.exit.5: ; preds = %__hugr__.const_fun_ %148 = bitcast i8* %147 to { i1, { i1, i64, i1 } }* %149 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %148, align 4 %.fca.0.extract11.i.6 = extractvalue { i1, { i1, i64, i1 } } %149, 0 - br i1 %.fca.0.extract11.i.6, label %__hugr__.const_fun_284.290.exit.6, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.6, label %__hugr__.const_fun_287.338.exit.6, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.6: ; preds = %__hugr__.const_fun_284.290.exit.5 +__hugr__.const_fun_287.338.exit.6: ; preds = %__hugr__.const_fun_287.338.exit.5 %150 = extractvalue { i1, { i1, i64, i1 } } %149, 1 %151 = getelementptr inbounds i8, i8* %111, i64 144 %152 = bitcast i8* %151 to { i1, i64, i1 }* @@ -435,9 +435,9 @@ __hugr__.const_fun_284.290.exit.6: ; preds = %__hugr__.const_fun_ %154 = bitcast i8* %153 to { i1, { i1, i64, i1 } }* %155 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %154, align 4 %.fca.0.extract11.i.7 = extractvalue { i1, { i1, i64, i1 } } %155, 0 - br i1 %.fca.0.extract11.i.7, label %__hugr__.const_fun_284.290.exit.7, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.7, label %__hugr__.const_fun_287.338.exit.7, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.7: ; preds = %__hugr__.const_fun_284.290.exit.6 +__hugr__.const_fun_287.338.exit.7: ; preds = %__hugr__.const_fun_287.338.exit.6 %156 = extractvalue { i1, { i1, i64, i1 } } %155, 1 %157 = getelementptr inbounds i8, i8* %111, i64 168 %158 = bitcast i8* %157 to { i1, i64, i1 }* @@ -446,9 +446,9 @@ __hugr__.const_fun_284.290.exit.7: ; preds = %__hugr__.const_fun_ %160 = bitcast i8* %159 to { i1, { i1, i64, i1 } }* %161 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %160, align 4 %.fca.0.extract11.i.8 = extractvalue { i1, { i1, i64, i1 } } %161, 0 - br i1 %.fca.0.extract11.i.8, label %__hugr__.const_fun_284.290.exit.8, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.8, label %__hugr__.const_fun_287.338.exit.8, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.8: ; preds = %__hugr__.const_fun_284.290.exit.7 +__hugr__.const_fun_287.338.exit.8: ; preds = %__hugr__.const_fun_287.338.exit.7 %162 = extractvalue { i1, { i1, i64, i1 } } %161, 1 %163 = getelementptr inbounds i8, i8* %111, i64 192 %164 = bitcast i8* %163 to { i1, i64, i1 }* @@ -457,86 +457,86 @@ __hugr__.const_fun_284.290.exit.8: ; preds = %__hugr__.const_fun_ %166 = bitcast i8* %165 to { i1, { i1, i64, i1 } }* %167 = load { i1, { i1, i64, i1 } }, { i1, { i1, i64, i1 } }* %166, align 4 %.fca.0.extract11.i.9 = extractvalue { i1, { i1, i64, i1 } } %167, 0 - br i1 %.fca.0.extract11.i.9, label %__hugr__.const_fun_284.290.exit.9, label %cond_570_case_0.i + br i1 %.fca.0.extract11.i.9, label %__hugr__.const_fun_287.338.exit.9, label %cond_558_case_0.i -__hugr__.const_fun_284.290.exit.9: ; preds = %__hugr__.const_fun_284.290.exit.8 +__hugr__.const_fun_287.338.exit.9: ; preds = %__hugr__.const_fun_287.338.exit.8 %168 = extractvalue { i1, { i1, i64, i1 } } %167, 1 %169 = getelementptr inbounds i8, i8* %111, i64 216 %170 = bitcast i8* %169 to { i1, i64, i1 }* store { i1, i64, i1 } %168, { i1, i64, i1 }* %170, align 4 tail call void @heap_free(i8* nonnull %63) tail call void @heap_free(i8* nonnull %64) - br label %__barray_check_bounds.exit888 + br label %__barray_check_bounds.exit882 -cond_165_case_0: ; preds = %cond_exit_165 +cond_169_case_0: ; preds = %cond_exit_169 %171 = load i64, i64* %114, align 4 %172 = or i64 %171, -1024 store i64 %172, i64* %114, align 4 %173 = icmp eq i64 %172, -1 - br i1 %173, label %loop_out139, label %mask_block_err.i886 + br i1 %173, label %loop_out135, label %mask_block_err.i880 -mask_block_err.i886: ; preds = %cond_165_case_0 +mask_block_err.i880: ; preds = %cond_169_case_0 tail call void @panic(i32 1002, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @"e_Array cont.EFA5AC45.0", i64 0, i64 0)) unreachable -__barray_check_bounds.exit888: ; preds = %__hugr__.const_fun_284.290.exit.9, %cond_exit_165 - %"167_0.0989" = phi i64 [ 0, %__hugr__.const_fun_284.290.exit.9 ], [ %174, %cond_exit_165 ] - %174 = add nuw nsw i64 %"167_0.0989", 1 - %175 = lshr i64 %"167_0.0989", 6 +__barray_check_bounds.exit882: ; preds = %__hugr__.const_fun_287.338.exit.9, %cond_exit_169 + %"172_0.0983" = phi i64 [ 0, %__hugr__.const_fun_287.338.exit.9 ], [ %174, %cond_exit_169 ] + %174 = add nuw nsw i64 %"172_0.0983", 1 + %175 = lshr i64 %"172_0.0983", 6 %176 = getelementptr inbounds i64, i64* %114, i64 %175 %177 = load i64, i64* %176, align 4 - %178 = shl nuw nsw i64 1, %"167_0.0989" + %178 = shl nuw nsw i64 1, %"172_0.0983" %179 = and i64 %177, %178 %.not = icmp eq i64 %179, 0 - br i1 %.not, label %__barray_mask_borrow.exit893, label %cond_exit_165 + br i1 %.not, label %__barray_mask_borrow.exit887, label %cond_exit_169 -__barray_mask_borrow.exit893: ; preds = %__barray_check_bounds.exit888 +__barray_mask_borrow.exit887: ; preds = %__barray_check_bounds.exit882 %180 = xor i64 %177, %178 store i64 %180, i64* %176, align 4 - %181 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %112, i64 %"167_0.0989" + %181 = getelementptr inbounds { i1, i64, i1 }, { i1, i64, i1 }* %112, i64 %"172_0.0983" %182 = load { i1, i64, i1 }, { i1, i64, i1 }* %181, align 4 - %.fca.0.extract511 = extractvalue { i1, i64, i1 } %182, 0 - br i1 %.fca.0.extract511, label %cond_501_case_1, label %cond_exit_165 + %.fca.0.extract505 = extractvalue { i1, i64, i1 } %182, 0 + br i1 %.fca.0.extract505, label %cond_496_case_1, label %cond_exit_169 -cond_exit_165: ; preds = %cond_501_case_1, %__barray_mask_borrow.exit893, %__barray_check_bounds.exit888 - %183 = icmp ult i64 %"167_0.0989", 9 - br i1 %183, label %__barray_check_bounds.exit888, label %cond_165_case_0 +cond_exit_169: ; preds = %cond_496_case_1, %__barray_mask_borrow.exit887, %__barray_check_bounds.exit882 + %183 = icmp ult i64 %"172_0.0983", 9 + br i1 %183, label %__barray_check_bounds.exit882, label %cond_169_case_0 -loop_out139: ; preds = %cond_165_case_0 +loop_out135: ; preds = %cond_169_case_0 tail call void @heap_free(i8* %111) tail call void @heap_free(i8* nonnull %113) %184 = load i64, i64* %87, align 4 %185 = and i64 %184, 1023 store i64 %185, i64* %87, align 4 %186 = icmp eq i64 %185, 0 - br i1 %186, label %__barray_check_none_borrowed.exit898, label %mask_block_err.i897 + br i1 %186, label %__barray_check_none_borrowed.exit892, label %mask_block_err.i891 -__barray_check_none_borrowed.exit898: ; preds = %loop_out139 +__barray_check_none_borrowed.exit892: ; preds = %loop_out135 %187 = tail call i8* @heap_alloc(i64 10) %188 = tail call i8* @heap_alloc(i64 8) %189 = bitcast i8* %188 to i64* store i64 0, i64* %189, align 1 %190 = load { i1, i64, i1 }, { i1, i64, i1 }* %85, align 4 - %.fca.0.extract.i899 = extractvalue { i1, i64, i1 } %190, 0 - %.fca.1.extract.i900 = extractvalue { i1, i64, i1 } %190, 1 - br i1 %.fca.0.extract.i899, label %cond_300_case_1.i, label %cond_300_case_0.i + %.fca.0.extract.i893 = extractvalue { i1, i64, i1 } %190, 0 + %.fca.1.extract.i894 = extractvalue { i1, i64, i1 } %190, 1 + br i1 %.fca.0.extract.i893, label %cond_300_case_1.i, label %cond_300_case_0.i -mask_block_err.i897: ; preds = %loop_out139 +mask_block_err.i891: ; preds = %loop_out135 tail call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable -cond_501_case_1: ; preds = %__barray_mask_borrow.exit893 - %.fca.1.extract512 = extractvalue { i1, i64, i1 } %182, 1 - tail call void @___dec_future_refcount(i64 %.fca.1.extract512) - br label %cond_exit_165 +cond_496_case_1: ; preds = %__barray_mask_borrow.exit887 + %.fca.1.extract506 = extractvalue { i1, i64, i1 } %182, 1 + tail call void @___dec_future_refcount(i64 %.fca.1.extract506) + br label %cond_exit_169 -cond_300_case_0.i: ; preds = %__barray_check_none_borrowed.exit898 +cond_300_case_0.i: ; preds = %__barray_check_none_borrowed.exit892 %.fca.2.extract.i = extractvalue { i1, i64, i1 } %190, 2 br label %__hugr__.array.__read_bool.3.271.exit -cond_300_case_1.i: ; preds = %__barray_check_none_borrowed.exit898 - %read_bool.i = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900) +cond_300_case_1.i: ; preds = %__barray_check_none_borrowed.exit892 + %read_bool.i = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894) br label %__hugr__.array.__read_bool.3.271.exit __hugr__.array.__read_bool.3.271.exit: ; preds = %cond_300_case_0.i, %cond_300_case_1.i @@ -546,17 +546,17 @@ __hugr__.array.__read_bool.3.271.exit: ; preds = %cond_300_case_0.i, %192 = getelementptr inbounds i8, i8* %84, i64 24 %193 = bitcast i8* %192 to { i1, i64, i1 }* %194 = load { i1, i64, i1 }, { i1, i64, i1 }* %193, align 4 - %.fca.0.extract.i899.1 = extractvalue { i1, i64, i1 } %194, 0 - %.fca.1.extract.i900.1 = extractvalue { i1, i64, i1 } %194, 1 - br i1 %.fca.0.extract.i899.1, label %cond_300_case_1.i.1, label %cond_300_case_0.i.1 + %.fca.0.extract.i893.1 = extractvalue { i1, i64, i1 } %194, 0 + %.fca.1.extract.i894.1 = extractvalue { i1, i64, i1 } %194, 1 + br i1 %.fca.0.extract.i893.1, label %cond_300_case_1.i.1, label %cond_300_case_0.i.1 cond_300_case_0.i.1: ; preds = %__hugr__.array.__read_bool.3.271.exit %.fca.2.extract.i.1 = extractvalue { i1, i64, i1 } %194, 2 br label %__hugr__.array.__read_bool.3.271.exit.1 cond_300_case_1.i.1: ; preds = %__hugr__.array.__read_bool.3.271.exit - %read_bool.i.1 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.1) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.1) + %read_bool.i.1 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.1) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.1) br label %__hugr__.array.__read_bool.3.271.exit.1 __hugr__.array.__read_bool.3.271.exit.1: ; preds = %cond_300_case_1.i.1, %cond_300_case_0.i.1 @@ -567,17 +567,17 @@ __hugr__.array.__read_bool.3.271.exit.1: ; preds = %cond_300_case_1.i.1 %197 = getelementptr inbounds i8, i8* %84, i64 48 %198 = bitcast i8* %197 to { i1, i64, i1 }* %199 = load { i1, i64, i1 }, { i1, i64, i1 }* %198, align 4 - %.fca.0.extract.i899.2 = extractvalue { i1, i64, i1 } %199, 0 - %.fca.1.extract.i900.2 = extractvalue { i1, i64, i1 } %199, 1 - br i1 %.fca.0.extract.i899.2, label %cond_300_case_1.i.2, label %cond_300_case_0.i.2 + %.fca.0.extract.i893.2 = extractvalue { i1, i64, i1 } %199, 0 + %.fca.1.extract.i894.2 = extractvalue { i1, i64, i1 } %199, 1 + br i1 %.fca.0.extract.i893.2, label %cond_300_case_1.i.2, label %cond_300_case_0.i.2 cond_300_case_0.i.2: ; preds = %__hugr__.array.__read_bool.3.271.exit.1 %.fca.2.extract.i.2 = extractvalue { i1, i64, i1 } %199, 2 br label %__hugr__.array.__read_bool.3.271.exit.2 cond_300_case_1.i.2: ; preds = %__hugr__.array.__read_bool.3.271.exit.1 - %read_bool.i.2 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.2) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.2) + %read_bool.i.2 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.2) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.2) br label %__hugr__.array.__read_bool.3.271.exit.2 __hugr__.array.__read_bool.3.271.exit.2: ; preds = %cond_300_case_1.i.2, %cond_300_case_0.i.2 @@ -588,17 +588,17 @@ __hugr__.array.__read_bool.3.271.exit.2: ; preds = %cond_300_case_1.i.2 %202 = getelementptr inbounds i8, i8* %84, i64 72 %203 = bitcast i8* %202 to { i1, i64, i1 }* %204 = load { i1, i64, i1 }, { i1, i64, i1 }* %203, align 4 - %.fca.0.extract.i899.3 = extractvalue { i1, i64, i1 } %204, 0 - %.fca.1.extract.i900.3 = extractvalue { i1, i64, i1 } %204, 1 - br i1 %.fca.0.extract.i899.3, label %cond_300_case_1.i.3, label %cond_300_case_0.i.3 + %.fca.0.extract.i893.3 = extractvalue { i1, i64, i1 } %204, 0 + %.fca.1.extract.i894.3 = extractvalue { i1, i64, i1 } %204, 1 + br i1 %.fca.0.extract.i893.3, label %cond_300_case_1.i.3, label %cond_300_case_0.i.3 cond_300_case_0.i.3: ; preds = %__hugr__.array.__read_bool.3.271.exit.2 %.fca.2.extract.i.3 = extractvalue { i1, i64, i1 } %204, 2 br label %__hugr__.array.__read_bool.3.271.exit.3 cond_300_case_1.i.3: ; preds = %__hugr__.array.__read_bool.3.271.exit.2 - %read_bool.i.3 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.3) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.3) + %read_bool.i.3 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.3) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.3) br label %__hugr__.array.__read_bool.3.271.exit.3 __hugr__.array.__read_bool.3.271.exit.3: ; preds = %cond_300_case_1.i.3, %cond_300_case_0.i.3 @@ -609,17 +609,17 @@ __hugr__.array.__read_bool.3.271.exit.3: ; preds = %cond_300_case_1.i.3 %207 = getelementptr inbounds i8, i8* %84, i64 96 %208 = bitcast i8* %207 to { i1, i64, i1 }* %209 = load { i1, i64, i1 }, { i1, i64, i1 }* %208, align 4 - %.fca.0.extract.i899.4 = extractvalue { i1, i64, i1 } %209, 0 - %.fca.1.extract.i900.4 = extractvalue { i1, i64, i1 } %209, 1 - br i1 %.fca.0.extract.i899.4, label %cond_300_case_1.i.4, label %cond_300_case_0.i.4 + %.fca.0.extract.i893.4 = extractvalue { i1, i64, i1 } %209, 0 + %.fca.1.extract.i894.4 = extractvalue { i1, i64, i1 } %209, 1 + br i1 %.fca.0.extract.i893.4, label %cond_300_case_1.i.4, label %cond_300_case_0.i.4 cond_300_case_0.i.4: ; preds = %__hugr__.array.__read_bool.3.271.exit.3 %.fca.2.extract.i.4 = extractvalue { i1, i64, i1 } %209, 2 br label %__hugr__.array.__read_bool.3.271.exit.4 cond_300_case_1.i.4: ; preds = %__hugr__.array.__read_bool.3.271.exit.3 - %read_bool.i.4 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.4) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.4) + %read_bool.i.4 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.4) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.4) br label %__hugr__.array.__read_bool.3.271.exit.4 __hugr__.array.__read_bool.3.271.exit.4: ; preds = %cond_300_case_1.i.4, %cond_300_case_0.i.4 @@ -630,17 +630,17 @@ __hugr__.array.__read_bool.3.271.exit.4: ; preds = %cond_300_case_1.i.4 %212 = getelementptr inbounds i8, i8* %84, i64 120 %213 = bitcast i8* %212 to { i1, i64, i1 }* %214 = load { i1, i64, i1 }, { i1, i64, i1 }* %213, align 4 - %.fca.0.extract.i899.5 = extractvalue { i1, i64, i1 } %214, 0 - %.fca.1.extract.i900.5 = extractvalue { i1, i64, i1 } %214, 1 - br i1 %.fca.0.extract.i899.5, label %cond_300_case_1.i.5, label %cond_300_case_0.i.5 + %.fca.0.extract.i893.5 = extractvalue { i1, i64, i1 } %214, 0 + %.fca.1.extract.i894.5 = extractvalue { i1, i64, i1 } %214, 1 + br i1 %.fca.0.extract.i893.5, label %cond_300_case_1.i.5, label %cond_300_case_0.i.5 cond_300_case_0.i.5: ; preds = %__hugr__.array.__read_bool.3.271.exit.4 %.fca.2.extract.i.5 = extractvalue { i1, i64, i1 } %214, 2 br label %__hugr__.array.__read_bool.3.271.exit.5 cond_300_case_1.i.5: ; preds = %__hugr__.array.__read_bool.3.271.exit.4 - %read_bool.i.5 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.5) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.5) + %read_bool.i.5 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.5) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.5) br label %__hugr__.array.__read_bool.3.271.exit.5 __hugr__.array.__read_bool.3.271.exit.5: ; preds = %cond_300_case_1.i.5, %cond_300_case_0.i.5 @@ -651,17 +651,17 @@ __hugr__.array.__read_bool.3.271.exit.5: ; preds = %cond_300_case_1.i.5 %217 = getelementptr inbounds i8, i8* %84, i64 144 %218 = bitcast i8* %217 to { i1, i64, i1 }* %219 = load { i1, i64, i1 }, { i1, i64, i1 }* %218, align 4 - %.fca.0.extract.i899.6 = extractvalue { i1, i64, i1 } %219, 0 - %.fca.1.extract.i900.6 = extractvalue { i1, i64, i1 } %219, 1 - br i1 %.fca.0.extract.i899.6, label %cond_300_case_1.i.6, label %cond_300_case_0.i.6 + %.fca.0.extract.i893.6 = extractvalue { i1, i64, i1 } %219, 0 + %.fca.1.extract.i894.6 = extractvalue { i1, i64, i1 } %219, 1 + br i1 %.fca.0.extract.i893.6, label %cond_300_case_1.i.6, label %cond_300_case_0.i.6 cond_300_case_0.i.6: ; preds = %__hugr__.array.__read_bool.3.271.exit.5 %.fca.2.extract.i.6 = extractvalue { i1, i64, i1 } %219, 2 br label %__hugr__.array.__read_bool.3.271.exit.6 cond_300_case_1.i.6: ; preds = %__hugr__.array.__read_bool.3.271.exit.5 - %read_bool.i.6 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.6) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.6) + %read_bool.i.6 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.6) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.6) br label %__hugr__.array.__read_bool.3.271.exit.6 __hugr__.array.__read_bool.3.271.exit.6: ; preds = %cond_300_case_1.i.6, %cond_300_case_0.i.6 @@ -672,17 +672,17 @@ __hugr__.array.__read_bool.3.271.exit.6: ; preds = %cond_300_case_1.i.6 %222 = getelementptr inbounds i8, i8* %84, i64 168 %223 = bitcast i8* %222 to { i1, i64, i1 }* %224 = load { i1, i64, i1 }, { i1, i64, i1 }* %223, align 4 - %.fca.0.extract.i899.7 = extractvalue { i1, i64, i1 } %224, 0 - %.fca.1.extract.i900.7 = extractvalue { i1, i64, i1 } %224, 1 - br i1 %.fca.0.extract.i899.7, label %cond_300_case_1.i.7, label %cond_300_case_0.i.7 + %.fca.0.extract.i893.7 = extractvalue { i1, i64, i1 } %224, 0 + %.fca.1.extract.i894.7 = extractvalue { i1, i64, i1 } %224, 1 + br i1 %.fca.0.extract.i893.7, label %cond_300_case_1.i.7, label %cond_300_case_0.i.7 cond_300_case_0.i.7: ; preds = %__hugr__.array.__read_bool.3.271.exit.6 %.fca.2.extract.i.7 = extractvalue { i1, i64, i1 } %224, 2 br label %__hugr__.array.__read_bool.3.271.exit.7 cond_300_case_1.i.7: ; preds = %__hugr__.array.__read_bool.3.271.exit.6 - %read_bool.i.7 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.7) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.7) + %read_bool.i.7 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.7) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.7) br label %__hugr__.array.__read_bool.3.271.exit.7 __hugr__.array.__read_bool.3.271.exit.7: ; preds = %cond_300_case_1.i.7, %cond_300_case_0.i.7 @@ -693,17 +693,17 @@ __hugr__.array.__read_bool.3.271.exit.7: ; preds = %cond_300_case_1.i.7 %227 = getelementptr inbounds i8, i8* %84, i64 192 %228 = bitcast i8* %227 to { i1, i64, i1 }* %229 = load { i1, i64, i1 }, { i1, i64, i1 }* %228, align 4 - %.fca.0.extract.i899.8 = extractvalue { i1, i64, i1 } %229, 0 - %.fca.1.extract.i900.8 = extractvalue { i1, i64, i1 } %229, 1 - br i1 %.fca.0.extract.i899.8, label %cond_300_case_1.i.8, label %cond_300_case_0.i.8 + %.fca.0.extract.i893.8 = extractvalue { i1, i64, i1 } %229, 0 + %.fca.1.extract.i894.8 = extractvalue { i1, i64, i1 } %229, 1 + br i1 %.fca.0.extract.i893.8, label %cond_300_case_1.i.8, label %cond_300_case_0.i.8 cond_300_case_0.i.8: ; preds = %__hugr__.array.__read_bool.3.271.exit.7 %.fca.2.extract.i.8 = extractvalue { i1, i64, i1 } %229, 2 br label %__hugr__.array.__read_bool.3.271.exit.8 cond_300_case_1.i.8: ; preds = %__hugr__.array.__read_bool.3.271.exit.7 - %read_bool.i.8 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.8) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.8) + %read_bool.i.8 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.8) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.8) br label %__hugr__.array.__read_bool.3.271.exit.8 __hugr__.array.__read_bool.3.271.exit.8: ; preds = %cond_300_case_1.i.8, %cond_300_case_0.i.8 @@ -714,17 +714,17 @@ __hugr__.array.__read_bool.3.271.exit.8: ; preds = %cond_300_case_1.i.8 %232 = getelementptr inbounds i8, i8* %84, i64 216 %233 = bitcast i8* %232 to { i1, i64, i1 }* %234 = load { i1, i64, i1 }, { i1, i64, i1 }* %233, align 4 - %.fca.0.extract.i899.9 = extractvalue { i1, i64, i1 } %234, 0 - %.fca.1.extract.i900.9 = extractvalue { i1, i64, i1 } %234, 1 - br i1 %.fca.0.extract.i899.9, label %cond_300_case_1.i.9, label %cond_300_case_0.i.9 + %.fca.0.extract.i893.9 = extractvalue { i1, i64, i1 } %234, 0 + %.fca.1.extract.i894.9 = extractvalue { i1, i64, i1 } %234, 1 + br i1 %.fca.0.extract.i893.9, label %cond_300_case_1.i.9, label %cond_300_case_0.i.9 cond_300_case_0.i.9: ; preds = %__hugr__.array.__read_bool.3.271.exit.8 %.fca.2.extract.i.9 = extractvalue { i1, i64, i1 } %234, 2 br label %__hugr__.array.__read_bool.3.271.exit.9 cond_300_case_1.i.9: ; preds = %__hugr__.array.__read_bool.3.271.exit.8 - %read_bool.i.9 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i900.9) - tail call void @___dec_future_refcount(i64 %.fca.1.extract.i900.9) + %read_bool.i.9 = tail call i1 @___read_future_bool(i64 %.fca.1.extract.i894.9) + tail call void @___dec_future_refcount(i64 %.fca.1.extract.i894.9) br label %__hugr__.array.__read_bool.3.271.exit.9 __hugr__.array.__read_bool.3.271.exit.9: ; preds = %cond_300_case_1.i.9, %cond_300_case_0.i.9 @@ -738,9 +738,9 @@ __hugr__.array.__read_bool.3.271.exit.9: ; preds = %cond_300_case_1.i.9 %238 = and i64 %237, 1023 store i64 %238, i64* %189, align 4 %239 = icmp eq i64 %238, 0 - br i1 %239, label %__barray_check_none_borrowed.exit905, label %mask_block_err.i904 + br i1 %239, label %__barray_check_none_borrowed.exit899, label %mask_block_err.i898 -__barray_check_none_borrowed.exit905: ; preds = %__hugr__.array.__read_bool.3.271.exit.9 +__barray_check_none_borrowed.exit899: ; preds = %__hugr__.array.__read_bool.3.271.exit.9 %out_arr_alloca = alloca <{ i32, i32, i1*, i1* }>, align 8 %x_ptr = getelementptr inbounds <{ i32, i32, i1*, i1* }>, <{ i32, i32, i1*, i1* }>* %out_arr_alloca, i64 0, i32 0 %y_ptr = getelementptr inbounds <{ i32, i32, i1*, i1* }>, <{ i32, i32, i1*, i1* }>* %out_arr_alloca, i64 0, i32 1 @@ -756,52 +756,52 @@ __barray_check_none_borrowed.exit905: ; preds = %__hugr__.array.__re store i8* %187, i8** %242, align 8 store i1* %.sub, i1** %mask_ptr, align 8 call void @print_bool_arr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @res_cs.46C3C4B5.0, i64 0, i64 0), i64 15, <{ i32, i32, i1*, i1* }>* nonnull %out_arr_alloca) - br label %__barray_check_bounds.exit913 + br label %__barray_check_bounds.exit907 -mask_block_err.i904: ; preds = %__hugr__.array.__read_bool.3.271.exit.9 +mask_block_err.i898: ; preds = %__hugr__.array.__read_bool.3.271.exit.9 tail call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable -__barray_check_bounds.exit913: ; preds = %cond_exit_95.1, %__barray_check_none_borrowed.exit905 - %"90_0.sroa.0.0972" = phi i64 [ 0, %__barray_check_none_borrowed.exit905 ], [ %252, %cond_exit_95.1 ] - %243 = or i64 %"90_0.sroa.0.0972", 1 - %244 = lshr i64 %"90_0.sroa.0.0972", 6 +__barray_check_bounds.exit907: ; preds = %cond_exit_95.1, %__barray_check_none_borrowed.exit899 + %"90_0.sroa.0.0966" = phi i64 [ 0, %__barray_check_none_borrowed.exit899 ], [ %252, %cond_exit_95.1 ] + %243 = or i64 %"90_0.sroa.0.0966", 1 + %244 = lshr i64 %"90_0.sroa.0.0966", 6 %245 = getelementptr inbounds i64, i64* %7, i64 %244 %246 = load i64, i64* %245, align 4 - %247 = and i64 %"90_0.sroa.0.0972", 62 + %247 = and i64 %"90_0.sroa.0.0966", 62 %248 = shl nuw i64 1, %247 %249 = and i64 %246, %248 - %.not.i914 = icmp eq i64 %249, 0 - br i1 %.not.i914, label %panic.i915, label %cond_exit_95 + %.not.i908 = icmp eq i64 %249, 0 + br i1 %.not.i908, label %panic.i909, label %cond_exit_95 -panic.i915: ; preds = %cond_exit_95, %__barray_check_bounds.exit913 +panic.i909: ; preds = %cond_exit_95, %__barray_check_bounds.exit907 call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -cond_exit_95: ; preds = %__barray_check_bounds.exit913 +cond_exit_95: ; preds = %__barray_check_bounds.exit907 %250 = xor i64 %246, %248 store i64 %250, i64* %245, align 4 - %251 = getelementptr inbounds i64, i64* %5, i64 %"90_0.sroa.0.0972" - store i64 %"90_0.sroa.0.0972", i64* %251, align 4 - %252 = add nuw nsw i64 %"90_0.sroa.0.0972", 2 - %253 = lshr i64 %"90_0.sroa.0.0972", 6 + %251 = getelementptr inbounds i64, i64* %5, i64 %"90_0.sroa.0.0966" + store i64 %"90_0.sroa.0.0966", i64* %251, align 4 + %252 = add nuw nsw i64 %"90_0.sroa.0.0966", 2 + %253 = lshr i64 %"90_0.sroa.0.0966", 6 %254 = getelementptr inbounds i64, i64* %7, i64 %253 %255 = load i64, i64* %254, align 4 %256 = and i64 %243, 63 %257 = shl nuw i64 1, %256 %258 = and i64 %255, %257 - %.not.i914.1 = icmp eq i64 %258, 0 - br i1 %.not.i914.1, label %panic.i915, label %cond_exit_95.1 + %.not.i908.1 = icmp eq i64 %258, 0 + br i1 %.not.i908.1, label %panic.i909, label %cond_exit_95.1 cond_exit_95.1: ; preds = %cond_exit_95 %259 = xor i64 %255, %257 store i64 %259, i64* %254, align 4 %260 = getelementptr inbounds i64, i64* %5, i64 %243 store i64 %243, i64* %260, align 4 - %exitcond983.not.1 = icmp eq i64 %252, 100 - br i1 %exitcond983.not.1, label %loop_out212, label %__barray_check_bounds.exit913 + %exitcond977.not.1 = icmp eq i64 %252, 100 + br i1 %exitcond977.not.1, label %loop_out208, label %__barray_check_bounds.exit907 -loop_out212: ; preds = %cond_exit_95.1 +loop_out208: ; preds = %cond_exit_95.1 %261 = getelementptr inbounds i8, i8* %6, i64 8 %262 = bitcast i8* %261 to i64* %263 = load i64, i64* %262, align 4 @@ -811,9 +811,9 @@ loop_out212: ; preds = %cond_exit_95.1 %266 = icmp eq i64 %265, 0 %267 = icmp eq i64 %264, 0 %or.cond = select i1 %266, i1 %267, i1 false - br i1 %or.cond, label %__barray_check_none_borrowed.exit921, label %mask_block_err.i920 + br i1 %or.cond, label %__barray_check_none_borrowed.exit915, label %mask_block_err.i914 -__barray_check_none_borrowed.exit921: ; preds = %loop_out212 +__barray_check_none_borrowed.exit915: ; preds = %loop_out208 %268 = call i8* @heap_alloc(i64 800) %269 = bitcast i8* %268 to i64* %270 = call i8* @heap_alloc(i64 16) @@ -827,62 +827,62 @@ __barray_check_none_borrowed.exit921: ; preds = %loop_out212 %274 = load i64, i64* %7, align 4 %275 = icmp eq i64 %274, 0 %276 = icmp eq i64 %273, 0 - %or.cond986 = select i1 %275, i1 %276, i1 false - br i1 %or.cond986, label %__barray_check_none_borrowed.exit926, label %mask_block_err.i925 + %or.cond980 = select i1 %275, i1 %276, i1 false + br i1 %or.cond980, label %__barray_check_none_borrowed.exit920, label %mask_block_err.i919 -mask_block_err.i920: ; preds = %loop_out212 +mask_block_err.i914: ; preds = %loop_out208 call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable -__barray_check_none_borrowed.exit926: ; preds = %__barray_check_none_borrowed.exit921 - %out_arr_alloca287 = alloca <{ i32, i32, i64*, i1* }>, align 8 - %x_ptr288 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca287, i64 0, i32 0 - %y_ptr289 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca287, i64 0, i32 1 - %arr_ptr290 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca287, i64 0, i32 2 - %mask_ptr291 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca287, i64 0, i32 3 +__barray_check_none_borrowed.exit920: ; preds = %__barray_check_none_borrowed.exit915 + %out_arr_alloca282 = alloca <{ i32, i32, i64*, i1* }>, align 8 + %x_ptr283 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca282, i64 0, i32 0 + %y_ptr284 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca282, i64 0, i32 1 + %arr_ptr285 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca282, i64 0, i32 2 + %mask_ptr286 = getelementptr inbounds <{ i32, i32, i64*, i1* }>, <{ i32, i32, i64*, i1* }>* %out_arr_alloca282, i64 0, i32 3 %277 = alloca [100 x i1], align 1 - %.sub635 = getelementptr inbounds [100 x i1], [100 x i1]* %277, i64 0, i64 0 + %.sub629 = getelementptr inbounds [100 x i1], [100 x i1]* %277, i64 0, i64 0 %278 = bitcast [100 x i1]* %277 to i8* call void @llvm.memset.p0i8.i64(i8* noundef nonnull align 1 dereferenceable(100) %278, i8 0, i64 100, i1 false) - store i32 100, i32* %x_ptr288, align 8 - store i32 1, i32* %y_ptr289, align 4 - %279 = bitcast i64** %arr_ptr290 to i8** + store i32 100, i32* %x_ptr283, align 8 + store i32 1, i32* %y_ptr284, align 4 + %279 = bitcast i64** %arr_ptr285 to i8** store i8* %4, i8** %279, align 8 - store i1* %.sub635, i1** %mask_ptr291, align 8 - call void @print_int_arr(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @res_is.F21393DB.0, i64 0, i64 0), i64 14, <{ i32, i32, i64*, i1* }>* nonnull %out_arr_alloca287) - br label %__barray_check_bounds.exit934 + store i1* %.sub629, i1** %mask_ptr286, align 8 + call void @print_int_arr(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @res_is.F21393DB.0, i64 0, i64 0), i64 14, <{ i32, i32, i64*, i1* }>* nonnull %out_arr_alloca282) + br label %__barray_check_bounds.exit928 -mask_block_err.i925: ; preds = %__barray_check_none_borrowed.exit921 +mask_block_err.i919: ; preds = %__barray_check_none_borrowed.exit915 call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable -__barray_check_bounds.exit934: ; preds = %cond_exit_130, %__barray_check_none_borrowed.exit926 - %"125_0.sroa.0.0974" = phi i64 [ 0, %__barray_check_none_borrowed.exit926 ], [ %280, %cond_exit_130 ] - %280 = add nuw nsw i64 %"125_0.sroa.0.0974", 1 - %281 = lshr i64 %"125_0.sroa.0.0974", 6 +__barray_check_bounds.exit928: ; preds = %cond_exit_130, %__barray_check_none_borrowed.exit920 + %"125_0.sroa.0.0968" = phi i64 [ 0, %__barray_check_none_borrowed.exit920 ], [ %280, %cond_exit_130 ] + %280 = add nuw nsw i64 %"125_0.sroa.0.0968", 1 + %281 = lshr i64 %"125_0.sroa.0.0968", 6 %282 = getelementptr inbounds i64, i64* %3, i64 %281 %283 = load i64, i64* %282, align 4 - %284 = and i64 %"125_0.sroa.0.0974", 63 + %284 = and i64 %"125_0.sroa.0.0968", 63 %285 = shl nuw i64 1, %284 %286 = and i64 %283, %285 - %.not.i935 = icmp eq i64 %286, 0 - br i1 %.not.i935, label %panic.i936, label %cond_exit_130 + %.not.i929 = icmp eq i64 %286, 0 + br i1 %.not.i929, label %panic.i930, label %cond_exit_130 -panic.i936: ; preds = %__barray_check_bounds.exit934 +panic.i930: ; preds = %__barray_check_bounds.exit928 call void @panic(i32 1002, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @"e_Array alre.5A300C2A.0", i64 0, i64 0)) unreachable -cond_exit_130: ; preds = %__barray_check_bounds.exit934 - %287 = sitofp i64 %"125_0.sroa.0.0974" to double +cond_exit_130: ; preds = %__barray_check_bounds.exit928 + %287 = sitofp i64 %"125_0.sroa.0.0968" to double %288 = fmul double %287, 6.250000e-02 %289 = xor i64 %283, %285 store i64 %289, i64* %282, align 4 - %290 = getelementptr inbounds double, double* %1, i64 %"125_0.sroa.0.0974" + %290 = getelementptr inbounds double, double* %1, i64 %"125_0.sroa.0.0968" store double %288, double* %290, align 8 - %exitcond984.not = icmp eq i64 %280, 100 - br i1 %exitcond984.not, label %loop_out299, label %__barray_check_bounds.exit934 + %exitcond978.not = icmp eq i64 %280, 100 + br i1 %exitcond978.not, label %loop_out294, label %__barray_check_bounds.exit928 -loop_out299: ; preds = %cond_exit_130 +loop_out294: ; preds = %cond_exit_130 %291 = getelementptr inbounds i8, i8* %2, i64 8 %292 = bitcast i8* %291 to i64* %293 = load i64, i64* %292, align 4 @@ -891,10 +891,10 @@ loop_out299: ; preds = %cond_exit_130 %295 = load i64, i64* %3, align 4 %296 = icmp eq i64 %295, 0 %297 = icmp eq i64 %294, 0 - %or.cond987 = select i1 %296, i1 %297, i1 false - br i1 %or.cond987, label %__barray_check_none_borrowed.exit942, label %mask_block_err.i941 + %or.cond981 = select i1 %296, i1 %297, i1 false + br i1 %or.cond981, label %__barray_check_none_borrowed.exit936, label %mask_block_err.i935 -__barray_check_none_borrowed.exit942: ; preds = %loop_out299 +__barray_check_none_borrowed.exit936: ; preds = %loop_out294 %298 = call i8* @heap_alloc(i64 800) %299 = bitcast i8* %298 to double* %300 = call i8* @heap_alloc(i64 16) @@ -908,32 +908,32 @@ __barray_check_none_borrowed.exit942: ; preds = %loop_out299 %304 = load i64, i64* %3, align 4 %305 = icmp eq i64 %304, 0 %306 = icmp eq i64 %303, 0 - %or.cond988 = select i1 %305, i1 %306, i1 false - br i1 %or.cond988, label %__barray_check_none_borrowed.exit947, label %mask_block_err.i946 + %or.cond982 = select i1 %305, i1 %306, i1 false + br i1 %or.cond982, label %__barray_check_none_borrowed.exit941, label %mask_block_err.i940 -mask_block_err.i941: ; preds = %loop_out299 +mask_block_err.i935: ; preds = %loop_out294 call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable -__barray_check_none_borrowed.exit947: ; preds = %__barray_check_none_borrowed.exit942 - %out_arr_alloca377 = alloca <{ i32, i32, double*, i1* }>, align 8 - %x_ptr378 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca377, i64 0, i32 0 - %y_ptr379 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca377, i64 0, i32 1 - %arr_ptr380 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca377, i64 0, i32 2 - %mask_ptr381 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca377, i64 0, i32 3 +__barray_check_none_borrowed.exit941: ; preds = %__barray_check_none_borrowed.exit936 + %out_arr_alloca371 = alloca <{ i32, i32, double*, i1* }>, align 8 + %x_ptr372 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca371, i64 0, i32 0 + %y_ptr373 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca371, i64 0, i32 1 + %arr_ptr374 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca371, i64 0, i32 2 + %mask_ptr375 = getelementptr inbounds <{ i32, i32, double*, i1* }>, <{ i32, i32, double*, i1* }>* %out_arr_alloca371, i64 0, i32 3 %307 = alloca [100 x i1], align 1 - %.sub736 = getelementptr inbounds [100 x i1], [100 x i1]* %307, i64 0, i64 0 + %.sub730 = getelementptr inbounds [100 x i1], [100 x i1]* %307, i64 0, i64 0 %308 = bitcast [100 x i1]* %307 to i8* call void @llvm.memset.p0i8.i64(i8* noundef nonnull align 1 dereferenceable(100) %308, i8 0, i64 100, i1 false) - store i32 100, i32* %x_ptr378, align 8 - store i32 1, i32* %y_ptr379, align 4 - %309 = bitcast double** %arr_ptr380 to i8** + store i32 100, i32* %x_ptr372, align 8 + store i32 1, i32* %y_ptr373, align 4 + %309 = bitcast double** %arr_ptr374 to i8** store i8* %0, i8** %309, align 8 - store i1* %.sub736, i1** %mask_ptr381, align 8 - call void @print_float_arr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @res_fs.CBD4AF54.0, i64 0, i64 0), i64 16, <{ i32, i32, double*, i1* }>* nonnull %out_arr_alloca377) + store i1* %.sub730, i1** %mask_ptr375, align 8 + call void @print_float_arr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @res_fs.CBD4AF54.0, i64 0, i64 0), i64 16, <{ i32, i32, double*, i1* }>* nonnull %out_arr_alloca371) ret void -mask_block_err.i946: ; preds = %__barray_check_none_borrowed.exit942 +mask_block_err.i940: ; preds = %__barray_check_none_borrowed.exit936 call void @panic(i32 1002, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @"e_Some array.A77EF32E.0", i64 0, i64 0)) unreachable } diff --git a/qis-compiler/rust/array.rs b/qis-compiler/rust/array.rs index 64dcd1c81..ab442b1ad 100644 --- a/qis-compiler/rust/array.rs +++ b/qis-compiler/rust/array.rs @@ -32,7 +32,7 @@ impl ArrayCodegen for SeleneHeapArrayCodegen { .builder() .build_call(malloc, &[size.into()], "")? .try_as_basic_value() - .unwrap_left(); + .unwrap_basic(); Ok(res.into_pointer_value()) } @@ -77,7 +77,7 @@ impl BorrowArrayCodegen for SeleneHeapBorrowArrayCodegen>( "validate_call", )? .try_as_basic_value() - .unwrap_left() + .unwrap_basic() .into_int_value(); verify_gpu_call(ctx, success, "gpu_validate_api")?; // Mark as validated @@ -708,10 +708,11 @@ fn emit_api_validation<'c, H: HugrView>( function } }; - ctx.builder() + let _ = ctx + .builder() .build_call(func, &[], "run_gpu_validation_call")? .try_as_basic_value() - .unwrap_right(); + .unwrap_instruction(); Ok(()) } @@ -752,7 +753,7 @@ fn emit_panic_with_gpu_error<'c, H: HugrView>( .builder() .build_call(gpu_get_error, &[], "error_message")? .try_as_basic_value() - .unwrap_left() + .unwrap_basic() .into_pointer_value(); // If it's null, replace with "No error message available" @@ -771,7 +772,8 @@ fn emit_panic_with_gpu_error<'c, H: HugrView>( )?; // Call panic_str with a generic error code and the message. - ctx.builder() + let _ = ctx + .builder() .build_call( selene_specific::panic_str_fn(ctx)?, &[ @@ -781,17 +783,17 @@ fn emit_panic_with_gpu_error<'c, H: HugrView>( "panic_str_call", )? .try_as_basic_value() - .unwrap_right(); + .unwrap_instruction(); builder.build_unreachable()?; builder.position_at_end(current_block); function } Some(f) => f, }; - builder + let _ = builder .build_call(handle_error, &[], "gpu_error_handler_call")? .try_as_basic_value() - .unwrap_right(); + .unwrap_instruction(); Ok(()) } @@ -841,14 +843,14 @@ fn verify_gpu_call<'c, H: HugrView>( } Some(f) => f, }; - builder + let _ = builder .build_call( handle_error, &[success_flag.into()], format!("{op_name}_handle_error").as_str(), )? .try_as_basic_value() - .unwrap_right(); + .unwrap_instruction(); Ok(()) } diff --git a/qis-compiler/rust/lib.rs b/qis-compiler/rust/lib.rs index 761f33df9..8a40bf043 100644 --- a/qis-compiler/rust/lib.rs +++ b/qis-compiler/rust/lib.rs @@ -102,6 +102,12 @@ impl From for ProcessErrs { } } +impl From for ProcessErrs { + fn from(value: inkwell::Error) -> Self { + Self(vec![value.to_string()]) + } +} + impl From for ProcessErrs { fn from(value: LLVMString) -> Self { Self(vec![value.to_string()]) @@ -270,7 +276,7 @@ fn wrap_main<'c>( let tc = builder .build_call(teardown, &[], "")? .try_as_basic_value() - .left() + .basic() .ok_or_else(|| anyhow!("get_tc has no return value"))?; // Return the initial time cursor let _ = builder.build_return(Some(&tc))?; @@ -351,7 +357,7 @@ fn compile<'c, 'hugr: 'c>( let node = ctx.metadata_node(md_vec.as_slice()); let _ = module .add_global_metadata(key, &node) - .map_err(Into::::into); + .map_err(ProcessErrs::from); } module.verify().map_err(Into::::into)?; Ok(module) diff --git a/qis-compiler/rust/utils.rs b/qis-compiler/rust/utils.rs index 652e0a4a8..ef267516c 100644 --- a/qis-compiler/rust/utils.rs +++ b/qis-compiler/rust/utils.rs @@ -1,6 +1,6 @@ use crate::REGISTRY; use anyhow::{Error, Result, anyhow}; -use tket::hugr::envelope::read_described_envelope; +use tket::hugr::envelope::read_envelope; use tket::hugr::ops::OpType; use tket::hugr::types::Term; use tket::hugr::{Hugr, HugrView}; @@ -12,7 +12,7 @@ use tket::extension::{TKET1_EXTENSION_ID, TKET1_OP_NAME}; /// Interprets the string as a hugr package and, verifies there is exactly one module in the /// package, then extracts and returns that module. pub fn read_hugr_envelope(bytes: &[u8]) -> Result { - let (desc, package) = read_described_envelope(bytes, ®ISTRY) + let (desc, package) = read_envelope(bytes, ®ISTRY) .map_err(|e| Error::new(e).context("Error loading HUGR package."))?; if package.modules.len() != 1 { diff --git a/tket-py/src/circuit/convert.rs b/tket-py/src/circuit/convert.rs index 09c1fb674..3d0d0e52d 100644 --- a/tket-py/src/circuit/convert.rs +++ b/tket-py/src/circuit/convert.rs @@ -63,7 +63,7 @@ where E: ConvertPyErr, F: FnOnce(Circuit, CircuitType) -> Result, { - let (circ, typ) = match Tk2Circuit::extract_bound(circ) { + let (circ, typ) = match Tk2Circuit::extract(circ.as_borrowed()) { // tket circuit Ok(t2circ) => (t2circ.circ, CircuitType::Tket), // tket1 circuit diff --git a/tket-py/src/circuit/tk2circuit.rs b/tket-py/src/circuit/tk2circuit.rs index fa61cdc9a..036612315 100644 --- a/tket-py/src/circuit/tk2circuit.rs +++ b/tket-py/src/circuit/tk2circuit.rs @@ -327,7 +327,7 @@ impl Tk2Circuit { /// /// Returns an error if the py object is not a Tk2Circuit. pub fn try_extract(circ: &Bound) -> PyResult { - circ.extract::() + circ.extract::().map_err(|e| e.into()) } } diff --git a/tket-py/src/ops.rs b/tket-py/src/ops.rs index d6e23f8b5..145faf235 100644 --- a/tket-py/src/ops.rs +++ b/tket-py/src/ops.rs @@ -183,7 +183,7 @@ impl PyPauli { /// Check if two Pauli matrices are equal. pub fn __eq__(&self, other: &Bound) -> bool { - let Ok(other): Result<&Bound, _> = other.downcast() else { + let Ok(other): Result<&Bound, _> = other.cast() else { return false; }; self.p == other.borrow().p diff --git a/tket-py/src/optimiser.rs b/tket-py/src/optimiser.rs index 47ec07967..657aab05f 100644 --- a/tket-py/src/optimiser.rs +++ b/tket-py/src/optimiser.rs @@ -47,8 +47,10 @@ impl BadgerCostFunction { } } -impl<'py> FromPyObject<'py> for BadgerCostFunction { - fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult { +impl<'py> FromPyObject<'_, 'py> for BadgerCostFunction { + type Error = PyErr; + + fn extract(ob: Borrowed<'_, 'py, PyAny>) -> Result { let str = ob.extract::<&str>()?; match str { "cx" => Ok(BadgerCostFunction::CXCount), diff --git a/tket-qsystem/src/extension/classical_compute/gpu.rs b/tket-qsystem/src/extension/classical_compute/gpu.rs index f2eb103c7..7fb02e0ce 100644 --- a/tket-qsystem/src/extension/classical_compute/gpu.rs +++ b/tket-qsystem/src/extension/classical_compute/gpu.rs @@ -165,8 +165,8 @@ impl MakeRegisteredOp for GpuOp { EXTENSION_ID } - fn extension_ref(&self) -> Weak { - Arc::downgrade(&EXTENSION) + fn extension_ref(&self) -> Arc { + EXTENSION.clone() } } @@ -328,12 +328,13 @@ mod test { inputs: inputs.clone(), outputs: outputs.clone(), }; - let module_ty = GpuType::Module.get_type(op.extension_id(), &op.extension_ref()); + let extension = Arc::downgrade(&op.extension_ref()); + let module_ty = GpuType::Module.get_type(op.extension_id(), &extension); let func_ty = Type::new_extension(GpuType::func_custom_type( inputs.clone(), outputs.clone(), op.extension_id(), - &op.extension_ref(), + &extension, )); assert_eq!( op.to_extension_op().unwrap().signature(), diff --git a/tket-qsystem/src/extension/classical_compute/wasm.rs b/tket-qsystem/src/extension/classical_compute/wasm.rs index c871e672d..91b5e22bf 100644 --- a/tket-qsystem/src/extension/classical_compute/wasm.rs +++ b/tket-qsystem/src/extension/classical_compute/wasm.rs @@ -165,8 +165,8 @@ impl MakeRegisteredOp for WasmOp { EXTENSION_ID } - fn extension_ref(&self) -> Weak { - Arc::downgrade(&EXTENSION) + fn extension_ref(&self) -> Arc { + EXTENSION.clone() } } @@ -309,12 +309,13 @@ mod test { inputs: inputs.clone(), outputs: outputs.clone(), }; - let module_ty = WasmType::Module.get_type(op.extension_id(), &op.extension_ref()); + let extension = Arc::downgrade(&op.extension_ref()); + let module_ty = WasmType::Module.get_type(op.extension_id(), &extension); let func_ty = Type::new_extension(WasmType::func_custom_type( inputs.clone(), outputs.clone(), op.extension_id(), - &op.extension_ref(), + &extension, )); assert_eq!( op.to_extension_op().unwrap().signature(), diff --git a/tket-qsystem/src/extension/futures.rs b/tket-qsystem/src/extension/futures.rs index 0d3a5b4e6..67e386e8c 100644 --- a/tket-qsystem/src/extension/futures.rs +++ b/tket-qsystem/src/extension/futures.rs @@ -196,8 +196,8 @@ impl MakeRegisteredOp for FutureOp { EXTENSION_ID } - fn extension_ref(&self) -> Weak { - Arc::downgrade(&EXTENSION) + fn extension_ref(&self) -> Arc { + EXTENSION.clone() } } diff --git a/tket-qsystem/src/extension/qsystem.rs b/tket-qsystem/src/extension/qsystem.rs index c377f3e92..40d29719a 100644 --- a/tket-qsystem/src/extension/qsystem.rs +++ b/tket-qsystem/src/extension/qsystem.rs @@ -174,8 +174,8 @@ impl MakeRegisteredOp for QSystemOp { EXTENSION_ID } - fn extension_ref(&self) -> Weak { - Arc::downgrade(&EXTENSION) + fn extension_ref(&self) -> Arc { + EXTENSION.clone() } } diff --git a/tket-qsystem/src/extension/qsystem/lower.rs b/tket-qsystem/src/extension/qsystem/lower.rs index 383d6baf6..38a0998b2 100644 --- a/tket-qsystem/src/extension/qsystem/lower.rs +++ b/tket-qsystem/src/extension/qsystem/lower.rs @@ -114,7 +114,7 @@ pub fn lower_tk2_op(hugr: &mut impl HugrMut) -> Result, L ReplaceOps::Tk2(tket_op) => { // Handle TketOp replacements if let Some(direct) = direct_map(tket_op) { - lowerer.replace_op( + lowerer.set_replace_op( &tket_op.into_extension_op(), NodeTemplate::SingleOp(direct.into()), ); @@ -130,7 +130,7 @@ pub fn lower_tk2_op(hugr: &mut impl HugrMut) -> Result, L *e.insert(inserted) } }; - lowerer.replace_op( + lowerer.set_replace_op( &tket_op.into_extension_op(), NodeTemplate::Call(func_node, vec![]), ); diff --git a/tket-qsystem/src/extension/random.rs b/tket-qsystem/src/extension/random.rs index 368fee24b..a2c251c89 100644 --- a/tket-qsystem/src/extension/random.rs +++ b/tket-qsystem/src/extension/random.rs @@ -182,8 +182,8 @@ impl MakeRegisteredOp for RandomOp { EXTENSION_ID } - fn extension_ref(&self) -> Weak { - Arc::downgrade(&EXTENSION) + fn extension_ref(&self) -> Arc { + EXTENSION.clone() } } diff --git a/tket-qsystem/src/extension/result.rs b/tket-qsystem/src/extension/result.rs index 67dd7f98f..bd3f1378f 100644 --- a/tket-qsystem/src/extension/result.rs +++ b/tket-qsystem/src/extension/result.rs @@ -1,7 +1,7 @@ //! This module defines the Hugr extension used to represent result reporting operations, //! with static string tags. //! -use std::sync::{Arc, Weak}; +use std::sync::Arc; use hugr::std_extensions::collections; use hugr::types::Signature; @@ -376,8 +376,8 @@ impl MakeRegisteredOp for ResultOp { EXTENSION_ID } - fn extension_ref(&self) -> Weak { - Arc::downgrade(&EXTENSION) + fn extension_ref(&self) -> Arc { + EXTENSION.clone() } } diff --git a/tket-qsystem/src/extension/utils.rs b/tket-qsystem/src/extension/utils.rs index ef3299dfe..41ae1cfb9 100644 --- a/tket-qsystem/src/extension/utils.rs +++ b/tket-qsystem/src/extension/utils.rs @@ -1,7 +1,7 @@ //! This module defines the "tket.qsystem.utils" extension, which includes the //! utility functions available for Quantinuum systems. -use std::sync::{Arc, Weak}; +use std::sync::Arc; use derive_more::derive::Display; use hugr::{ @@ -101,8 +101,8 @@ impl MakeRegisteredOp for UtilsOp { EXTENSION_ID } - fn extension_ref(&self) -> Weak { - Arc::downgrade(&EXTENSION) + fn extension_ref(&self) -> Arc { + EXTENSION.clone() } } diff --git a/tket-qsystem/src/llvm/futures.rs b/tket-qsystem/src/llvm/futures.rs index 73fd64d05..993f744b9 100644 --- a/tket-qsystem/src/llvm/futures.rs +++ b/tket-qsystem/src/llvm/futures.rs @@ -150,7 +150,7 @@ impl<'c, H: HugrView> FuturesEmitter<'c, '_, '_, H> { .builder() .build_call(read_func, &[arg.into()], "read_bool")? .try_as_basic_value() - .unwrap_left() + .unwrap_basic() .into_int_value(); let dec_refcount_func = self.get_func_dec_refcount()?; self.builder() @@ -172,7 +172,7 @@ impl<'c, H: HugrView> FuturesEmitter<'c, '_, '_, H> { .builder() .build_call(read_func, &[arg.into()], "read_uint")? .try_as_basic_value() - .unwrap_left(); + .unwrap_basic(); let dec_refcount_func = self.get_func_dec_refcount()?; self.builder() .build_call(dec_refcount_func, &[arg.into()], "dec_refcount")?; diff --git a/tket-qsystem/src/llvm/qsystem.rs b/tket-qsystem/src/llvm/qsystem.rs index 7f89986c3..8dc4e83f5 100644 --- a/tket-qsystem/src/llvm/qsystem.rs +++ b/tket-qsystem/src/llvm/qsystem.rs @@ -181,7 +181,7 @@ impl QSystemCodegenExtension { "measure_i1", )? .try_as_basic_value() - .unwrap_left() + .unwrap_basic() .into_int_value(); let result = builder.build_select(result_i1, true_val, false_val, "measure")?; if op == QSystemOp::Measure { @@ -217,7 +217,7 @@ impl QSystemCodegenExtension { "lazy_measure", )? .try_as_basic_value() - .unwrap_left(); + .unwrap_basic(); builder.build_call( self.runtime_func(context, RuntimeFunction::QFree)?, &[qb.into()], @@ -239,7 +239,7 @@ impl QSystemCodegenExtension { "lazy_measure_leaked", )? .try_as_basic_value() - .unwrap_left(); + .unwrap_basic(); builder.build_call( self.runtime_func(context, RuntimeFunction::QFree)?, &[qb.into()], @@ -260,7 +260,7 @@ impl QSystemCodegenExtension { "lazy_measure", )? .try_as_basic_value() - .unwrap_left(); + .unwrap_basic(); builder.build_call( self.runtime_func(context, RuntimeFunction::Reset)?, &[qb.into()], @@ -283,7 +283,7 @@ impl QSystemCodegenExtension { "qalloc", )? .try_as_basic_value() - .unwrap_left(); + .unwrap_basic(); let max_qb = self .0 diff --git a/tket-qsystem/src/llvm/random.rs b/tket-qsystem/src/llvm/random.rs index 1cab4c1cb..133c09d35 100644 --- a/tket-qsystem/src/llvm/random.rs +++ b/tket-qsystem/src/llvm/random.rs @@ -87,7 +87,7 @@ impl<'c, H: HugrView> RandomEmitter<'c, '_, '_, H> { name, )? .try_as_basic_value() - .unwrap_left(); + .unwrap_basic(); args.outputs .finish(self.builder(), [result, self.rng_context()]) } diff --git a/tket-qsystem/src/llvm/utils.rs b/tket-qsystem/src/llvm/utils.rs index 75079cec2..b91a6aaab 100644 --- a/tket-qsystem/src/llvm/utils.rs +++ b/tket-qsystem/src/llvm/utils.rs @@ -44,7 +44,7 @@ fn emit_utils_op>( .builder() .build_call(fn_get_cur_shot, &[], "shot")? .try_as_basic_value() - .unwrap_left(); + .unwrap_basic(); args.outputs.finish(ctx.builder(), [result]) } } diff --git a/tket-qsystem/src/lower_drops.rs b/tket-qsystem/src/lower_drops.rs index 4f5c91c61..9e1b5101a 100644 --- a/tket-qsystem/src/lower_drops.rs +++ b/tket-qsystem/src/lower_drops.rs @@ -1,10 +1,9 @@ /// Contains a pass to lower "drop" ops from the Guppy extension -use hugr::algorithms::replace_types::{NodeTemplate, ReplaceTypesError, ReplacementOptions}; +use hugr::algorithms::replace_types::{Linearizer, NodeTemplate, ReplaceTypesError}; use hugr::algorithms::{ComposablePass, ReplaceTypes}; -use hugr::builder::{Container, DFGBuilder}; use hugr::extension::prelude::bool_t; use hugr::extension::simple_op::MakeRegisteredOp; -use hugr::types::{Signature, Term}; +use hugr::types::TypeArg; use hugr::{Node, hugr::hugrmut::HugrMut}; use tket::extension::guppy::{DROP_OP_NAME, GUPPY_EXTENSION}; @@ -38,7 +37,7 @@ impl> ComposablePass for LowerDropsPass { } .to_extension_op() .unwrap(); - rt.linearizer() + rt.linearizer_mut() .register_simple( future_type(bool_t()).as_extension().unwrap().clone(), NodeTemplate::SingleOp(dup_op.into()), @@ -46,18 +45,14 @@ impl> ComposablePass for LowerDropsPass { ) .unwrap(); - rt.replace_parametrized_op_with( + rt.set_replace_parametrized_op( GUPPY_EXTENSION.get_op(DROP_OP_NAME.as_str()).unwrap(), - |targs| { - let [Term::Runtime(ty)] = targs else { + |args, rt| { + let [TypeArg::Runtime(ty)] = args else { panic!("Expected just one type") }; - // The Hugr here is invalid, so we have to pull it out manually - let mut dfb = DFGBuilder::new(Signature::new(ty.clone(), vec![])).unwrap(); - let h = std::mem::take(dfb.hugr_mut()); - Some(NodeTemplate::CompoundOp(Box::new(h))) + Ok(Some(rt.get_linearizer().copy_discard_op(ty, 0)?)) }, - ReplacementOptions::default().with_linearization(true), ); rt.run(hugr) } @@ -67,7 +62,7 @@ impl> ComposablePass for LowerDropsPass { mod test { use std::sync::Arc; - use hugr::builder::{Dataflow, DataflowHugr, inout_sig}; + use hugr::builder::{DFGBuilder, Dataflow, DataflowHugr, inout_sig}; use hugr::ops::ExtensionOp; use hugr::{Hugr, HugrView}; use hugr::{extension::prelude::usize_t, std_extensions::collections::array::array_type}; diff --git a/tket-qsystem/src/replace_bools.rs b/tket-qsystem/src/replace_bools.rs index f5056a8a2..98c087811 100644 --- a/tket-qsystem/src/replace_bools.rs +++ b/tket-qsystem/src/replace_bools.rs @@ -3,7 +3,7 @@ mod static_array; use derive_more::{Display, Error, From}; -use hugr::algorithms::replace_types::{NodeTemplate, ReplaceTypesError, ReplacementOptions}; +use hugr::algorithms::replace_types::{Linearizer, NodeTemplate, ReplaceTypesError}; use hugr::algorithms::{ ComposablePass, ReplaceTypes, ensure_no_nonlocal_edges, non_local::FindNonLocalEdgesError, }; @@ -24,6 +24,7 @@ use hugr::std_extensions::collections::{ use hugr::std_extensions::logic::LogicOp; use hugr::types::{SumType, Term, Type}; use hugr::{Hugr, HugrView, Node, Wire, hugr::hugrmut::HugrMut, type_row}; +use itertools::Itertools; use static_array::{ReplaceStaticArrayBoolPass, ReplaceStaticArrayBoolPassError}; use tket::TketOp; use tket::extension::{ @@ -214,16 +215,7 @@ fn measure_reset_dest() -> NodeTemplate { NodeTemplate::CompoundOp(Box::new(h)) } -fn copy_dfg(ty: Type) -> Hugr { - let mut dfb = DFGBuilder::new(inout_sig(ty.clone(), vec![ty.clone(), ty])).unwrap(); - let mut h = std::mem::take(dfb.hugr_mut()); - let [inp, outp] = h.get_io(h.entrypoint()).unwrap(); - h.connect(inp, 0, outp, 0); - h.connect(inp, 0, outp, 1); - h -} - -fn barray_get_dest(size: u64, elem_ty: Type) -> NodeTemplate { +fn barray_get_dest(rt: &ReplaceTypes, size: u64, elem_ty: Type) -> NodeTemplate { let array_ty = borrow_array_type(size, elem_ty.clone()); let opt_el = option_type(elem_ty.clone()); let mut dfb = DFGBuilder::new(inout_sig( @@ -266,10 +258,25 @@ fn barray_get_dest(size: u64, elem_ty: Type) -> NodeTemplate { ) .unwrap() .outputs_arr(); - let [elem1, elem2] = in_range - .add_hugr_with_wires(copy_dfg(elem_ty.clone()), [elem]) + + let in_range_container = in_range.container_node(); + let copy_discard = rt + .get_linearizer() + .copy_discard_op(&elem_ty, 2) .unwrap() - .outputs_arr(); + .add_hugr(in_range.hugr_mut(), in_range_container) + .unwrap(); + in_range + .hugr_mut() + .connect(elem.node(), elem.source(), copy_discard, 0); + let [elem1, elem2] = in_range + .hugr_mut() + .node_outputs(copy_discard) + .map(|p| Wire::new(copy_discard, p)) + .take(2) + .collect_array() + .unwrap(); + let [arr] = in_range .add_dataflow_op( BArrayUnsafeOpDef::r#return.to_concrete(elem_ty.clone(), size), @@ -295,7 +302,7 @@ fn lowerer() -> ReplaceTypes { let mut lw = ReplaceTypes::default(); // Replace tket.bool type. - lw.replace_type(bool_type().as_extension().unwrap().clone(), bool_dest()); + lw.set_replace_type(bool_type().as_extension().unwrap().clone(), bool_dest()); let dup_op = FutureOp { op: FutureOpDef::Dup, typ: bool_t(), @@ -308,7 +315,7 @@ fn lowerer() -> ReplaceTypes { } .to_extension_op() .unwrap(); - lw.linearizer() + lw.linearizer_mut() .register_simple( future_type(bool_t()).as_extension().unwrap().clone(), NodeTemplate::SingleOp(dup_op.into()), @@ -337,22 +344,22 @@ fn lowerer() -> ReplaceTypes { // Replace all tket.bool ops. let read_op = BoolOp::read.to_extension_op().unwrap(); - lw.replace_op(&read_op, read_op_dest()); + lw.set_replace_op(&read_op, read_op_dest()); let make_opaque_op = BoolOp::make_opaque.to_extension_op().unwrap(); - lw.replace_op(&make_opaque_op, make_opaque_op_dest()); + lw.set_replace_op(&make_opaque_op, make_opaque_op_dest()); for op in [BoolOp::eq, BoolOp::and, BoolOp::or, BoolOp::xor] { - lw.replace_op(&op.to_extension_op().unwrap(), binary_logic_op_dest(&op)); + lw.set_replace_op(&op.to_extension_op().unwrap(), binary_logic_op_dest(&op)); } let not_op = BoolOp::not.to_extension_op().unwrap(); - lw.replace_op(¬_op, not_op_dest()); + lw.set_replace_op(¬_op, not_op_dest()); // Replace measure ops with lazy versions. let tket_measure_free = TketOp::MeasureFree.to_extension_op().unwrap(); let qsystem_measure = QSystemOp::Measure.to_extension_op().unwrap(); let qsystem_measure_reset = QSystemOp::MeasureReset.to_extension_op().unwrap(); - lw.replace_op(&tket_measure_free, measure_dest()); - lw.replace_op(&qsystem_measure, measure_dest()); - lw.replace_op(&qsystem_measure_reset, measure_reset_dest()); + lw.set_replace_op(&tket_measure_free, measure_dest()); + lw.set_replace_op(&qsystem_measure, measure_dest()); + lw.set_replace_op(&qsystem_measure_reset, measure_reset_dest()); // Replace (borrow/)array ops that used to have with copyable bounds with DFGs that // the linearizer can act on now that the elements are no longer copyable. @@ -366,57 +373,58 @@ fn lowerer() -> ReplaceTypes { borrow_array_type as fn(u64, Type) -> Type, ), ] { - lw.replace_parametrized_op_with( + lw.set_replace_parametrized_op( array_ext.get_op(ARRAY_CLONE_OP_ID.as_str()).unwrap(), - move |args| { + move |args, rt| { let [size, elem_ty] = args else { unreachable!() }; let size = size.as_nat().unwrap(); let elem_ty = elem_ty.as_runtime().unwrap(); - (!elem_ty.copyable()).then(|| { - NodeTemplate::CompoundOp(Box::new(copy_dfg(type_fn(size, elem_ty.clone())))) - }) + if elem_ty.copyable() { + return Ok(None); + } + + let array_ty = type_fn(size, elem_ty); + Ok(Some(rt.get_linearizer().copy_discard_op(&array_ty, 2)?)) }, - ReplacementOptions::default().with_linearization(true), ); let drop_op_def = GUPPY_EXTENSION.get_op(DROP_OP_NAME.as_str()).unwrap(); - lw.replace_parametrized_op( + lw.set_replace_parametrized_op( array_ext.get_op(ARRAY_DISCARD_OP_ID.as_str()).unwrap(), - move |args| { + move |args, _| { let [size, elem_ty] = args else { unreachable!() }; let size = size.as_nat().unwrap(); let elem_ty = elem_ty.as_runtime().unwrap(); if elem_ty.copyable() { - return None; + return Ok(None); } let drop_op = ExtensionOp::new( drop_op_def.clone(), vec![type_fn(size, elem_ty.clone()).into()], ) .unwrap(); - Some(NodeTemplate::SingleOp(drop_op.into())) + Ok(Some(NodeTemplate::SingleOp(drop_op.into()))) }, ); } - lw.replace_parametrized_op_with( + lw.set_replace_parametrized_op( borrow_array::EXTENSION .get_op(GenericArrayOpDef::::get.opdef_id().as_str()) .unwrap(), - |args| { + |args, rt| { let [Term::BoundedNat(size), Term::Runtime(elem_ty)] = args else { unreachable!() }; if elem_ty.copyable() { - return None; + return Ok(None); } - Some(barray_get_dest(*size, elem_ty.clone())) + Ok(Some(barray_get_dest(rt, *size, elem_ty.clone()))) }, - ReplacementOptions::default().with_linearization(true), ); lw diff --git a/tket-qsystem/src/replace_bools/static_array.rs b/tket-qsystem/src/replace_bools/static_array.rs index 84e54cbfb..6cee3e3fe 100644 --- a/tket-qsystem/src/replace_bools/static_array.rs +++ b/tket-qsystem/src/replace_bools/static_array.rs @@ -72,7 +72,7 @@ fn inner_replace_types() -> ReplaceTypes { }; replace_const_static_array(sav, rt) }); - inner.replace_type(bool_type().as_extension().unwrap().clone(), bool_t()); + inner.set_replace_type(bool_type().as_extension().unwrap().clone(), bool_t()); inner.replace_consts( bool_type().as_extension().unwrap().clone(), |const_bool, _| { @@ -120,7 +120,7 @@ fn outer_replace_types() -> ReplaceTypes { replace_const_static_array(sav, &inner) } }); - outer.replace_parametrized_type(static_array_typedef, { + outer.set_replace_parametrized_type(static_array_typedef, { let inner = inner.clone(); move |args| { let mut element_ty = { @@ -133,25 +133,25 @@ fn outer_replace_types() -> ReplaceTypes { changed.then_some(static_array_type(element_ty)) } }); - outer.replace_parametrized_op( + outer.set_replace_parametrized_op( static_array::EXTENSION .get_op(&StaticArrayOpDef::get.opdef_id()) .unwrap(), { let inner = inner.clone(); - move |args| { + move |args, _| { let [element_ty] = args else { unreachable!() }; - get_op_dest(&inner, element_ty.as_runtime().unwrap()) + Ok(get_op_dest(&inner, element_ty.as_runtime().unwrap())) } }, ); - outer.replace_parametrized_op( + outer.set_replace_parametrized_op( static_array::EXTENSION .get_op(&StaticArrayOpDef::len.opdef_id()) .unwrap(), - move |args| { + move |args, _| { let [element_ty] = args else { unreachable!() }; - len_op_dest(&inner, element_ty.as_runtime().unwrap()) + Ok(len_op_dest(&inner, element_ty.as_runtime().unwrap())) }, ); outer diff --git a/tket/src/circuit.rs b/tket/src/circuit.rs index 805f85ccc..0075179b1 100644 --- a/tket/src/circuit.rs +++ b/tket/src/circuit.rs @@ -15,7 +15,7 @@ pub use hash::CircuitHash; use hugr::extension::prelude::{NoopDef, TupleOpDef}; use hugr::extension::simple_op::MakeOpDef; use hugr::hugr::views::sibling_subgraph::InvalidSubgraph; -use hugr::hugr::views::{ExtractionResult, SiblingSubgraph}; +use hugr::hugr::views::{ExtractionResult, RootChecked, SiblingSubgraph}; use hugr::ops::handle::DataflowParentID; use itertools::Either::{Left, Right}; @@ -351,7 +351,10 @@ impl> Circuit { where T: Clone, { - SiblingSubgraph::try_new_dataflow_subgraph::<_, DataflowParentID>(self.hugr()) + let Ok(checked) = RootChecked::try_new(self.hugr()) else { + return Err(InvalidSubgraph::NonDataflowRegion); + }; + SiblingSubgraph::try_new_dataflow_subgraph::<_, DataflowParentID>(checked) } /// Compute the cost of the circuit based on a per-operation cost function. diff --git a/tket/src/circuit/command.rs b/tket/src/circuit/command.rs index 309030546..960615363 100644 --- a/tket/src/circuit/command.rs +++ b/tket/src/circuit/command.rs @@ -6,7 +6,7 @@ use std::collections::hash_map::Entry; use std::collections::{HashMap, HashSet}; use std::iter::FusedIterator; -use hugr::hugr::NodeMetadata; +use hugr::metadata::Metadata; use hugr::ops::{OpTag, OpTrait}; use hugr::{HugrView, IncomingPort, OutgoingPort}; use hugr_core::hugr::internal::{HugrInternals, PortgraphNodeMap}; @@ -159,8 +159,8 @@ impl<'circ, T: HugrView> Command<'circ, T> { /// Returns a metadata value associated with the command's node. #[inline] - pub fn metadata(&self, key: impl AsRef) -> Option<&NodeMetadata> { - self.circ.hugr().get_metadata(self.node, key) + pub fn metadata(&self) -> Option> { + self.circ.hugr().get_metadata::(self.node) } } diff --git a/tket/src/extension/bool.rs b/tket/src/extension/bool.rs index 6ef82234f..4a7d42ca2 100644 --- a/tket/src/extension/bool.rs +++ b/tket/src/extension/bool.rs @@ -184,8 +184,8 @@ impl MakeRegisteredOp for BoolOp { BOOL_EXTENSION_ID } - fn extension_ref(&self) -> Weak { - Arc::downgrade(&BOOL_EXTENSION) + fn extension_ref(&self) -> Arc { + BOOL_EXTENSION.clone() } } /// An extension trait for [Dataflow] providing methods to add "tket.bool" diff --git a/tket/src/extension/debug.rs b/tket/src/extension/debug.rs index 1a606e45b..ea089cc5c 100644 --- a/tket/src/extension/debug.rs +++ b/tket/src/extension/debug.rs @@ -141,8 +141,8 @@ impl MakeRegisteredOp for StateResult { DEBUG_EXTENSION_ID } - fn extension_ref(&self) -> Weak { - Arc::downgrade(&DEBUG_EXTENSION) + fn extension_ref(&self) -> Arc { + DEBUG_EXTENSION.clone() } } diff --git a/tket/src/extension/global_phase.rs b/tket/src/extension/global_phase.rs index 441ff99fa..a687c69e3 100644 --- a/tket/src/extension/global_phase.rs +++ b/tket/src/extension/global_phase.rs @@ -107,8 +107,8 @@ impl MakeRegisteredOp for GlobalPhase { GLOBAL_PHASE_EXTENSION_ID.to_owned() } - fn extension_ref(&self) -> Weak { - Arc::::downgrade(&GLOBAL_PHASE_EXTENSION) + fn extension_ref(&self) -> Arc { + GLOBAL_PHASE_EXTENSION.clone() } } diff --git a/tket/src/extension/rotation.rs b/tket/src/extension/rotation.rs index ceca61f87..0d4d71eac 100644 --- a/tket/src/extension/rotation.rs +++ b/tket/src/extension/rotation.rs @@ -196,8 +196,8 @@ impl MakeRegisteredOp for RotationOp { ROTATION_EXTENSION_ID } - fn extension_ref(&self) -> Weak { - Arc::downgrade(&ROTATION_EXTENSION) + fn extension_ref(&self) -> Arc { + ROTATION_EXTENSION.clone() } } diff --git a/tket/src/extension/sympy.rs b/tket/src/extension/sympy.rs index 28c8ccb0a..62bde774a 100644 --- a/tket/src/extension/sympy.rs +++ b/tket/src/extension/sympy.rs @@ -112,8 +112,8 @@ impl MakeRegisteredOp for SympyOp { TKET_EXTENSION_ID.to_owned() } - fn extension_ref(&self) -> Weak { - Arc::downgrade(&TKET_EXTENSION) + fn extension_ref(&self) -> Arc { + TKET_EXTENSION.clone() } } diff --git a/tket/src/lib.rs b/tket/src/lib.rs index c3f565ca1..c4b8d9dec 100644 --- a/tket/src/lib.rs +++ b/tket/src/lib.rs @@ -47,6 +47,7 @@ pub mod circuit; pub mod extension; +pub mod metadata; pub mod modifier; pub(crate) mod ops; pub mod optimiser; diff --git a/tket/src/metadata.rs b/tket/src/metadata.rs new file mode 100644 index 000000000..06bc004bc --- /dev/null +++ b/tket/src/metadata.rs @@ -0,0 +1,75 @@ +//! (Incomplete) Collection of metadata keys used throughout tket. + +use crate::rewrite::trace::RewriteTrace; +use hugr_core::metadata::Metadata; +use tket_json_rs::register::{Bit, Qubit}; + +/// Metadata key for the number of qubits that a HUGR node expects to be required for execution. +/// +/// This value is only valid when set at the entrypoint function node. TODO discuss this +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub struct MaxQubits; +impl Metadata for MaxQubits { + const KEY: &'static str = "TKET.expected_qubits"; // TODO think about this name really hard + type Type<'hugr> = u32; +} + +/// Metadata key for traced rewrites that were applied during circuit transformation. +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub struct CircuitRewriteTraces; +impl Metadata for CircuitRewriteTraces { + const KEY: &'static str = "TKET.rewrites"; + type Type<'hugr> = Vec; +} + +/// Metadata key for flagging unitarity constraints on a HUGR node +/// +/// See crate::modifier::ModifierFlags TODO discuss this +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub struct Unitary; +impl Metadata for Unitary { + const KEY: &'static str = "TKET.unitary"; // TODO think about this name really hard + type Type<'hugr> = u8; +} + +// Metadata keys migrated from TKET1 + +/// Metadata key for explicit names for the input parameter wires. +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub struct InputParameters; +impl Metadata for InputParameters { + const KEY: &'static str = "TKET1.input_parameters"; + type Type<'hugr> = Vec; +} + +/// Metadata key for a tket1 operation "opgroup" field. +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub struct OpGroup; +impl Metadata for OpGroup { + const KEY: &'static str = "TKET1.opgroup"; + type Type<'hugr> = &'hugr str; +} + +/// Metadata key for explicit names for the input bit registers. +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub struct BitRegisters; +impl Metadata for BitRegisters { + const KEY: &'static str = "TKET1.bit_registers"; + type Type<'hugr> = Vec; +} + +/// Metadata key for explicit names for the input qubit registers. +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub struct QubitRegisters; +impl Metadata for QubitRegisters { + const KEY: &'static str = "TKET1.qubit_registers"; + type Type<'hugr> = Vec; +} + +/// Metadata key for the global phase +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub struct Phase; +impl Metadata for Phase { + const KEY: &'static str = "TKET1.phase"; + type Type<'hugr> = &'hugr str; +} diff --git a/tket/src/modifier.rs b/tket/src/modifier.rs index ad52c77b6..ef4a8178f 100644 --- a/tket/src/modifier.rs +++ b/tket/src/modifier.rs @@ -21,6 +21,7 @@ pub mod dagger; pub mod modifier_resolver; pub mod power; +use crate::metadata; pub use pass::ModifierResolverPass; /// An accumulated modifier that combines control, dagger, and power modifiers. @@ -63,8 +64,7 @@ struct ModifierFlags { impl ModifierFlags { fn from_metadata(h: &impl HugrView, n: N) -> Option { - h.get_metadata(n, "unitary") - .and_then(serde_json::Value::as_u64) + h.get_metadata::(n) .map(|num| ModifierFlags { dagger: (num & 1) != 0, control: (num & 2) != 0, @@ -83,7 +83,7 @@ impl ModifierFlags { if self.power { num |= 4; } - *h.get_metadata_mut(n, "unitary") = serde_json::Value::from(num); + h.set_metadata::(n, num); } fn satisfies(&self, combined: &CombinedModifier) -> bool { diff --git a/tket/src/modifier/modifier_resolver.rs b/tket/src/modifier/modifier_resolver.rs index e4f3efe9c..b81a60035 100644 --- a/tket/src/modifier/modifier_resolver.rs +++ b/tket/src/modifier/modifier_resolver.rs @@ -1155,6 +1155,7 @@ mod tests { use crate::{ TketOp, extension::modifier::{CONTROL_OP_ID, DAGGER_OP_ID, MODIFIER_EXTENSION}, + metadata, }; use super::*; @@ -1164,7 +1165,8 @@ mod tests { } impl SetUnitary for T { fn set_unitary(&mut self) { - self.set_metadata("unitary", 7); + let node = self.container_node(); + self.hugr_mut().set_metadata::(node, 7); } } diff --git a/tket/src/ops.rs b/tket/src/ops.rs index d691474fc..a9b5c88f9 100644 --- a/tket/src/ops.rs +++ b/tket/src/ops.rs @@ -312,8 +312,8 @@ impl MakeRegisteredOp for TketOp { EXTENSION_ID.to_owned() } - fn extension_ref(&self) -> Weak { - Arc::::downgrade(&TKET_EXTENSION) + fn extension_ref(&self) -> Arc { + TKET_EXTENSION.clone() } } diff --git a/tket/src/passes/chunks.rs b/tket/src/passes/chunks.rs index abdeaeae3..b61a28919 100644 --- a/tket/src/passes/chunks.rs +++ b/tket/src/passes/chunks.rs @@ -9,8 +9,8 @@ use std::ops::{Index, IndexMut}; use derive_more::From; use hugr::builder::{Container, FunctionBuilder}; use hugr::hugr::hugrmut::HugrMut; -use hugr::hugr::views::SiblingSubgraph; use hugr::hugr::views::sibling_subgraph::TopoConvexChecker; +use hugr::hugr::views::{RootChecked, SiblingSubgraph}; use hugr::hugr::{HugrError, NodeMetadataMap}; use hugr::ops::OpType; use hugr::ops::handle::DataflowParentID; @@ -107,8 +107,11 @@ impl Chunk { let [chunk_inp, chunk_out] = chunk.get_io(chunk_root).unwrap(); // Insert the chunk circuit into the original circuit. + let Ok(checked) = RootChecked::try_new(&chunk) else { + panic!("The chunk circuit is no longer a dataflow graph"); + }; let subgraph = - SiblingSubgraph::::try_new_dataflow_subgraph::<_, DataflowParentID>(&chunk) + SiblingSubgraph::::try_new_dataflow_subgraph::<_, DataflowParentID>(checked) .unwrap_or_else(|e| panic!("The chunk circuit is no longer a dataflow graph: {e}")); let node_map = circ.insert_subgraph(root, &chunk, &subgraph); diff --git a/tket/src/passes/unpack_container/op_function_map.rs b/tket/src/passes/unpack_container/op_function_map.rs index 24f9c5431..dd2eeb871 100644 --- a/tket/src/passes/unpack_container/op_function_map.rs +++ b/tket/src/passes/unpack_container/op_function_map.rs @@ -120,7 +120,7 @@ impl OpFunctionMap { let func_node = hugr .insert_hugr(hugr.module_root(), func_def) .inserted_entrypoint; - lowerer.replace_op(&op, NodeTemplate::Call(func_node, vec![])); + lowerer.set_replace_op(&op, NodeTemplate::Call(func_node, vec![])); } } } diff --git a/tket/src/resource.rs b/tket/src/resource.rs index 3a1e3ce98..339e83e27 100644 --- a/tket/src/resource.rs +++ b/tket/src/resource.rs @@ -154,9 +154,13 @@ pub(crate) mod tests { #[case] add_rz: bool, #[case] add_const_rz: bool, ) { + use hugr::hugr::views::RootChecked; + let circ = circ(n_qubits, add_rz, add_const_rz); - let subgraph = - SiblingSubgraph::try_new_dataflow_subgraph::<_, DataflowParentID>(&circ).unwrap(); + let subgraph = SiblingSubgraph::try_new_dataflow_subgraph::<_, DataflowParentID>( + RootChecked::try_new(&circ).expect("Entrypoint should be a dataflow parent."), + ) + .unwrap(); let scope = ResourceScope::new(&circ, subgraph); let info = ResourceScopeReport::from(&scope); diff --git a/tket/src/rewrite/trace.rs b/tket/src/rewrite/trace.rs index 0306260a0..33a9486dc 100644 --- a/tket/src/rewrite/trace.rs +++ b/tket/src/rewrite/trace.rs @@ -2,17 +2,12 @@ //! //! This is only tracked if the `rewrite-tracing` feature is enabled. -use hugr::hugr::NodeMetadata; +use crate::{Circuit, metadata}; use hugr::hugr::hugrmut::HugrMut; -use itertools::Itertools; - -use crate::Circuit; +use serde::{Deserialize, Serialize}; use super::CircuitRewrite; -/// Metadata key for the circuit rewrite trace. -pub const METADATA_REWRITES: &str = "TKET.rewrites"; - /// Global read-only flag for enabling rewrite tracing. /// Enable it by setting the `rewrite-tracing` feature. /// @@ -24,7 +19,7 @@ pub const REWRITE_TRACING_ENABLED: bool = cfg!(feature = "rewrite-tracing"); /// /// Traces are only enabled if the `rewrite-tracing` feature is enabled and /// [`Circuit::enable_rewrite_tracing`] is called on the circuit. -#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[derive(Deserialize, Serialize, Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[repr(transparent)] pub struct RewriteTrace { /// A count of the number of individual patterns matched for this rewrite step. @@ -51,22 +46,6 @@ impl RewriteTrace { } } -impl From<&serde_json::Value> for RewriteTrace { - #[inline] - fn from(value: &serde_json::Value) -> Self { - Self { - individual_matches: value.as_u64().unwrap() as u16, - } - } -} - -impl From for serde_json::Value { - #[inline] - fn from(trace: RewriteTrace) -> Self { - serde_json::Value::from(trace.individual_matches) - } -} - /// Implementation for rewrite tracing in circuits. /// /// This is only tracked if the `rewrite-tracing` feature is enabled and @@ -79,9 +58,12 @@ impl Circuit { return; } let root = self.parent(); - let meta = self.hugr_mut().get_metadata_mut(root, METADATA_REWRITES); - if *meta == NodeMetadata::Null { - *meta = NodeMetadata::Array(vec![]); + let hugr = self.hugr_mut(); + if hugr + .get_metadata::(root) + .is_none() + { + hugr.set_metadata::(root, vec![]); } } @@ -95,16 +77,16 @@ impl Circuit { } let root = self.parent(); match self - .hugr_mut() - .get_metadata_mut(root, METADATA_REWRITES) - .as_array_mut() + .hugr() + .get_metadata::(root) { - Some(meta) => { - let rewrite = rewrite.into(); + Some(mut meta) => { meta.push(rewrite.into()); + self.hugr_mut() + .set_metadata::(root, meta); true } - // Tracing was not enable for this circuit. + // Tracing was not enabled for this circuit. None => false, } } @@ -117,8 +99,9 @@ impl Circuit { if !REWRITE_TRACING_ENABLED { return None; } - let meta = self.hugr().get_metadata(self.parent(), METADATA_REWRITES)?; - let rewrites = meta.as_array()?; - Some(rewrites.iter().map_into()) + let ve = self + .hugr() + .get_metadata::(self.parent()); + ve.map(Vec::into_iter) } } diff --git a/tket/src/serialize.rs b/tket/src/serialize.rs index 8094e5dcf..2e24bff5d 100644 --- a/tket/src/serialize.rs +++ b/tket/src/serialize.rs @@ -3,7 +3,7 @@ //! See [`crate::serialize::pytket`] for serialization to and from the legacy pytket format. pub mod pytket; -pub use hugr::envelope::{EnvelopeConfig, EnvelopeError}; +pub use hugr::envelope::EnvelopeConfig; use hugr::hugr::hugrmut::HugrMut; use std::io; @@ -29,22 +29,22 @@ impl Circuit { &self, writer: impl io::Write, config: EnvelopeConfig, - ) -> Result<(), EnvelopeError> { - let pkg = self.wrap_package()?; + ) -> Result<(), hugr::envelope::WriteError> { + let pkg = self.wrap_package(); pkg.store(writer, config)?; Ok(()) } /// Store the circuit as a String in HUGR envelope format. - pub fn store_str(&self, config: EnvelopeConfig) -> Result { - let pkg = self.wrap_package()?; + pub fn store_str(&self, config: EnvelopeConfig) -> Result { + let pkg = self.wrap_package(); pkg.store_str(config) } /// Wrap the circuit in a package. - fn wrap_package(&self) -> Result { + fn wrap_package(&self) -> Package { let hugr = Circuit::to_owned(self).into_hugr(); - Ok(Package::from_hugr(hugr)) + Package::from_hugr(hugr) } } @@ -163,7 +163,7 @@ pub enum CircuitLoadError { CircuitLoadError(CircuitError), /// Error loading an envelope. #[from] - EnvelopeError(EnvelopeError), + EnvelopeError(hugr::envelope::ReadError), /// Error validating the loaded circuit. #[from] ValidationError(ValidationError), diff --git a/tket/src/serialize/pytket.rs b/tket/src/serialize/pytket.rs index 7bddea205..780faaa5d 100644 --- a/tket/src/serialize/pytket.rs +++ b/tket/src/serialize/pytket.rs @@ -44,19 +44,6 @@ use crate::circuit::Circuit; use crate::extension::rotation::rotation_type; pub use crate::passes::pytket::lower_to_pytket; -/// Prefix used for storing metadata in the hugr nodes. -pub const METADATA_PREFIX: &str = "TKET1"; -/// The global phase specified as metadata. -pub const METADATA_PHASE: &str = "TKET1.phase"; -/// Explicit names for the input qubit registers. -pub const METADATA_Q_REGISTERS: &str = "TKET1.qubit_registers"; -/// Explicit names for the input bit registers. -pub const METADATA_B_REGISTERS: &str = "TKET1.bit_registers"; -/// A tket1 operation "opgroup" field. -pub const METADATA_OPGROUP: &str = "TKET1.opgroup"; -/// Explicit names for the input parameter wires. -pub const METADATA_INPUT_PARAMETERS: &str = "TKET1.input_parameters"; - /// A serialized representation of a [`Circuit`]. /// /// Implemented by [`SerialCircuit`], the JSON format used by tket1's `pytket` library. diff --git a/tket/src/serialize/pytket/decoder.rs b/tket/src/serialize/pytket/decoder.rs index 45597a688..e6f0ec264 100644 --- a/tket/src/serialize/pytket/decoder.rs +++ b/tket/src/serialize/pytket/decoder.rs @@ -26,16 +26,13 @@ use hugr::{Hugr, HugrView, Node, OutgoingPort, Wire}; use tracked_elem::{TrackedBitId, TrackedQubitId}; use itertools::Itertools; -use serde_json::json; use tket_json_rs::circuit_json; use tket_json_rs::circuit_json::SerialCircuit; -use super::{ - METADATA_B_REGISTERS, METADATA_INPUT_PARAMETERS, METADATA_PHASE, METADATA_Q_REGISTERS, - PytketDecodeError, -}; +use super::PytketDecodeError; use crate::TketOp; use crate::extension::rotation::rotation_type; +use crate::metadata; use crate::serialize::pytket::circuit::{ AdditionalNodesAndWires, EncodedCircuitInfo, StraightThroughWire, }; @@ -178,9 +175,14 @@ impl<'h> PytketDecoderContext<'h> { fn init_metadata(dfg: &mut DFGBuilder<&mut Hugr>, serialcirc: &SerialCircuit) { // Metadata. The circuit requires "name", and we store other things that // should pass through the serialization roundtrip. - dfg.set_metadata(METADATA_PHASE, json!(serialcirc.phase)); - dfg.set_metadata(METADATA_Q_REGISTERS, json!(serialcirc.qubits)); - dfg.set_metadata(METADATA_B_REGISTERS, json!(serialcirc.bits)); + + let node = dfg.container_node(); + dfg.hugr_mut() + .set_metadata::(node, &serialcirc.phase); + dfg.hugr_mut() + .set_metadata::(node, serialcirc.qubits.clone()); // TODO Do we find something better than clone? + dfg.hugr_mut() + .set_metadata::(node, serialcirc.bits.clone()); } /// Initialize the wire tracker with the input wires. @@ -434,10 +436,13 @@ impl<'h> PytketDecoderContext<'h> { // Store the name for the input parameter wires let input_params = self.wire_tracker.finish(); if !input_params.is_empty() { - self.builder.set_metadata( - METADATA_INPUT_PARAMETERS, - json!(input_params.into_iter().collect_vec()), - ); + let node = self.builder.container_node(); + self.builder + .hugr_mut() + .set_metadata::( + node, + input_params.into_iter().collect_vec(), + ); } Ok(self diff --git a/tket/src/serialize/pytket/decoder/subgraph.rs b/tket/src/serialize/pytket/decoder/subgraph.rs index 99b6a3d25..677323071 100644 --- a/tket/src/serialize/pytket/decoder/subgraph.rs +++ b/tket/src/serialize/pytket/decoder/subgraph.rs @@ -14,6 +14,7 @@ use crate::extension::rotation::rotation_type; use crate::serialize::pytket::decoder::{ DecodeStatus, FoundWire, LoadedParameter, PytketDecoderContext, TrackedBit, TrackedQubit, }; +use crate::serialize::pytket::error::BarrierPayloadError; use crate::serialize::pytket::extension::RegisterCount; use crate::serialize::pytket::opaque::{ EncodedEdgeID, OpaqueSubgraph, OpaqueSubgraphPayload, SubgraphId, @@ -269,7 +270,7 @@ impl<'h> PytketDecoderContext<'h> { params: &[LoadedParameter], ) -> Result { let to_insert_hugr = Hugr::load_str(hugr_envelope, Some(self.extension_registry())) - .map_err(|e| PytketDecodeErrorInner::UnsupportedSubgraphInlinePayload { source: e })?; + .map_err(|e| BarrierPayloadError::HugrRead(e).wrap())?; let to_insert_signature = to_insert_hugr.inner_function_type().unwrap(); let module = self.builder.hugr().module_root(); diff --git a/tket/src/serialize/pytket/encoder.rs b/tket/src/serialize/pytket/encoder.rs index 1dc9f1bf2..7a590d44d 100644 --- a/tket/src/serialize/pytket/encoder.rs +++ b/tket/src/serialize/pytket/encoder.rs @@ -25,10 +25,9 @@ use tket_json_rs::circuit_json::{self, SerialCircuit}; use unsupported_tracker::UnsupportedTracker; use super::opaque::OpaqueSubgraphs; -use super::{ - METADATA_OPGROUP, METADATA_PHASE, METADATA_Q_REGISTERS, PytketEncodeError, PytketEncodeOpError, -}; +use super::{PytketEncodeError, PytketEncodeOpError}; use crate::circuit::Circuit; +use crate::metadata; use crate::serialize::pytket::circuit::{ AdditionalNodesAndWires, AdditionalSubgraph, EncodedCircuitInfo, }; @@ -170,8 +169,8 @@ impl PytketEncoderContext { .filter(|s| !s.is_empty()); // Recover other parameters stored in the metadata - let phase = match hugr.get_metadata(region, METADATA_PHASE) { - Some(p) => p.as_str().unwrap().to_string(), + let phase = match hugr.get_metadata::(region) { + Some(p) => p.to_string(), None => "0".to_string(), }; @@ -439,7 +438,7 @@ impl PytketEncoderContext { node: H::Node, circ: &Circuit, options: EmitCommandOptions, - make_operation: impl FnOnce(MakeOperationArgs<'_>) -> tket_json_rs::circuit_json::Operation, + make_operation: impl FnOnce(MakeOperationArgs<'_>) -> circuit_json::Operation, ) -> Result<(), PytketEncodeError> { let TrackedValues { mut qubits, @@ -462,8 +461,7 @@ impl PytketEncoderContext { // Preserve the pytket opgroup, if it got stored in the metadata. let opgroup: Option = circ .hugr() - .get_metadata(node, METADATA_OPGROUP) - .and_then(serde_json::Value::as_str) + .get_metadata::(node) .map(ToString::to_string); let args = MakeOperationArgs { diff --git a/tket/src/serialize/pytket/encoder/value_tracker.rs b/tket/src/serialize/pytket/encoder/value_tracker.rs index 227fd540c..2b0df1173 100644 --- a/tket/src/serialize/pytket/encoder/value_tracker.rs +++ b/tket/src/serialize/pytket/encoder/value_tracker.rs @@ -15,20 +15,19 @@ use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet}; use hugr::core::HugrNode; use hugr::ops::OpParent; use hugr::{HugrView, Wire}; +use hugr_core::metadata::Metadata; use itertools::Itertools; use tket_json_rs::circuit_json; use tket_json_rs::register::ElementId as RegisterUnit; use crate::circuit::Circuit; +use crate::metadata; use crate::serialize::pytket::circuit::StraightThroughWire; use crate::serialize::pytket::extension::RegisterCount; -use crate::serialize::pytket::{ - METADATA_B_REGISTERS, METADATA_INPUT_PARAMETERS, PytketEncodeError, PytketEncodeOpError, - RegisterHash, -}; +use crate::serialize::pytket::{PytketEncodeError, PytketEncodeOpError, RegisterHash}; +use super::PytketEncoderConfig; use super::unit_generator::RegisterUnitGenerator; -use super::{METADATA_Q_REGISTERS, PytketEncoderConfig}; /// A structure for tracking qubits used in the circuit being encoded. /// @@ -218,10 +217,16 @@ impl ValueTracker { config: &PytketEncoderConfig, ) -> Result> { let param_variable_names: Vec = - read_metadata_json_list(circ, region, METADATA_INPUT_PARAMETERS); + read_metadata_json_list::<_, _, metadata::InputParameters>(circ, region); let mut tracker = ValueTracker { - qubits: read_metadata_json_list(circ, region, METADATA_Q_REGISTERS), - bits: read_metadata_json_list(circ, region, METADATA_B_REGISTERS), + qubits: read_metadata_json_list::<_, _, metadata::QubitRegisters>(circ, region) + .into_iter() + .map(|q| q.id) + .collect_vec(), + bits: read_metadata_json_list::<_, _, metadata::BitRegisters>(circ, region) + .into_iter() + .map(|b| b.id) + .collect_vec(), params: Vec::with_capacity(param_variable_names.len()), wires: BTreeMap::new(), unused_qubits: BTreeSet::new(), @@ -575,16 +580,17 @@ impl IntoIterator for TrackedValues { } /// Read a json-encoded vector of values from the circuit's root metadata. -fn read_metadata_json_list( +fn read_metadata_json_list( circ: &Circuit, region: H::Node, - metadata_key: &str, -) -> Vec { - let Some(value) = circ.hugr().get_metadata(region, metadata_key) else { - return vec![]; - }; - - serde_json::from_value::>(value.clone()).unwrap_or_default() +) -> Vec +where + for<'hugr> K::Type<'hugr>: Into>, +{ + circ.hugr() + .get_metadata::(region) + .map(Into::into) + .unwrap_or_default() } /// Compute the final unit permutation for a circuit. diff --git a/tket/src/serialize/pytket/error.rs b/tket/src/serialize/pytket/error.rs index 09550297a..dc9783c27 100644 --- a/tket/src/serialize/pytket/error.rs +++ b/tket/src/serialize/pytket/error.rs @@ -3,7 +3,7 @@ use derive_more::{Display, Error, From}; use hugr::Wire; use hugr::core::HugrNode; -use hugr::envelope::EnvelopeError; +use hugr::extension::resolution::ExtensionResolutionError; use hugr::ops::OpType; use itertools::Itertools; use tket_json_rs::register::ElementId; @@ -450,13 +450,8 @@ pub enum PytketDecodeErrorInner { id: SubgraphId, }, /// Cannot decode Hugr from an unsupported subgraph payload in a pytket barrier operation. - #[display( - "Cannot decode Hugr from an inline subgraph payload in a pytket barrier operation. {source}" - )] - UnsupportedSubgraphInlinePayload { - /// The envelope decoding error. - source: EnvelopeError, - }, + #[display("{_0}")] + UnsupportedBarrierPayload(BarrierPayloadError), /// Cannot translate a wire from one type to another. #[display("Cannot translate {wire} from type {initial_type} to type {target_type}{}", context.as_ref().map(|s| format!(". {s}")).unwrap_or_default() @@ -479,3 +474,27 @@ impl PytketDecodeErrorInner { PytketDecodeError::from(self) } } + +/// Sub-errors for [PytketDecodeError] raised when the payload of an opaque +/// pytket barrier fails to be decoded as a +/// [OpaqueSubgraphPayload][super::opaque::OpaqueSubgraphPayload]. +#[derive(derive_more::Debug, Display, Error)] +#[non_exhaustive] +pub enum BarrierPayloadError { + /// Cannot decode the payload as a JSON string. + #[display("Cannot decode the opaque subgraph payload from a JSON string. {_0}")] + SerdeDecoding(serde_json::Error), + /// Cannot decode the Hugr encoded in an opaque subgraph payload. + #[display("Cannot decode the Hugr encoded in an opaque subgraph payload. {_0}")] + HugrRead(hugr::envelope::ReadError), + /// Cannot resolve the extension references in the opaque subgraph payload. + #[display("Cannot resolve the extension references in the opaque subgraph payload. {_0}")] + ExtensionResolution(ExtensionResolutionError), +} + +impl BarrierPayloadError { + /// Wrap the error in a [PytketDecodeError]. + pub fn wrap(self) -> PytketDecodeError { + PytketDecodeErrorInner::UnsupportedBarrierPayload(self).wrap() + } +} diff --git a/tket/src/serialize/pytket/opaque/payload.rs b/tket/src/serialize/pytket/opaque/payload.rs index b7827993d..dde10ec44 100644 --- a/tket/src/serialize/pytket/opaque/payload.rs +++ b/tket/src/serialize/pytket/opaque/payload.rs @@ -1,18 +1,17 @@ //! Definitions of the payloads for opaque barrier metadata in pytket circuits. use hugr::core::HugrNode; -use hugr::envelope::{EnvelopeConfig, EnvelopeError}; +use hugr::envelope::EnvelopeConfig; +use hugr::extension::ExtensionRegistry; use hugr::extension::resolution::{WeakExtensionRegistry, resolve_type_extensions}; -use hugr::extension::{ExtensionRegistry, ExtensionRegistryLoadError}; use hugr::package::Package; use hugr::types::Type; use hugr::{HugrView, Wire}; use itertools::Itertools; +use crate::serialize::pytket::error::BarrierPayloadError; use crate::serialize::pytket::opaque::OpaqueSubgraph; -use crate::serialize::pytket::{ - PytketDecodeError, PytketDecodeErrorInner, PytketEncodeError, PytketEncodeOpError, -}; +use crate::serialize::pytket::{PytketDecodeError, PytketEncodeError, PytketEncodeOpError}; use super::SubgraphId; @@ -192,12 +191,8 @@ impl OpaqueSubgraphPayload { /// /// Updates weak extension references inside the definition after loading. pub fn load_str(json: &str, extensions: &ExtensionRegistry) -> Result { - let mut payload: Self = serde_json::from_str(json).map_err(|e| { - PytketDecodeErrorInner::UnsupportedSubgraphInlinePayload { - source: EnvelopeError::SerdeError { source: e }, - } - .wrap() - })?; + let mut payload: Self = + serde_json::from_str(json).map_err(|e| BarrierPayloadError::SerdeDecoding(e).wrap())?; // Resolve the extension ops and types in the inline payload. if let Self::Inline { @@ -208,15 +203,8 @@ impl OpaqueSubgraphPayload { // Resolve the cached input/output types. for (ty, _) in inputs.iter_mut().chain(outputs.iter_mut()) { - resolve_type_extensions(ty, &extensions).map_err(|e| { - let registry_load_e = - ExtensionRegistryLoadError::ExtensionResolutionError(Box::new(e)); - let envelope_e = EnvelopeError::ExtensionLoad { - source: registry_load_e, - }; - PytketDecodeErrorInner::UnsupportedSubgraphInlinePayload { source: envelope_e } - .wrap() - })?; + resolve_type_extensions(ty, &extensions) + .map_err(|e| BarrierPayloadError::ExtensionResolution(e).wrap())?; } } diff --git a/tket/src/serialize/pytket/tests.rs b/tket/src/serialize/pytket/tests.rs index d03b3aae2..5bb405323 100644 --- a/tket/src/serialize/pytket/tests.rs +++ b/tket/src/serialize/pytket/tests.rs @@ -13,25 +13,14 @@ use hugr::std_extensions::arithmetic::float_types::{ConstF64, float64_type}; use rayon::iter::ParallelIterator; use std::sync::Arc; -use hugr::HugrView; -use hugr::hugr::hugrmut::HugrMut; -use hugr::ops::handle::FuncID; -use hugr::ops::{OpParent, OpType, Value}; -use hugr::std_extensions::arithmetic::float_ops::FloatOps; -use hugr::types::{Signature, SumType}; -use itertools::Itertools; -use rstest::{fixture, rstest}; -use tket_json_rs::circuit_json::{self, SerialCircuit}; -use tket_json_rs::optype; -use tket_json_rs::register; - -use super::{METADATA_INPUT_PARAMETERS, METADATA_Q_REGISTERS, TKETDecode}; +use super::TKETDecode; use crate::TketOp; use crate::circuit::Circuit; use crate::extension::TKET1_EXTENSION_ID; use crate::extension::bool::{BoolOp, bool_type}; use crate::extension::rotation::{ConstRotation, RotationOp, rotation_type}; use crate::extension::sympy::SympyOpDef; +use crate::metadata; use crate::serialize::pytket::PytketEncodeError; use crate::serialize::pytket::extension::{CoreDecoder, OpaqueTk1Op, PreludeEmitter}; use crate::serialize::pytket::{ @@ -39,6 +28,18 @@ use crate::serialize::pytket::{ PytketDecodeErrorInner, PytketDecoderConfig, PytketEncodeOpError, PytketEncoderConfig, default_decoder_config, default_encoder_config, }; +use hugr::HugrView; +use hugr::hugr::hugrmut::HugrMut; +use hugr::ops::handle::FuncID; +use hugr::ops::{OpParent, OpType, Value}; +use hugr::std_extensions::arithmetic::float_ops::FloatOps; +use hugr::types::{Signature, SumType}; +use itertools::Itertools; +use rstest::{fixture, rstest}; +use tket_json_rs::circuit_json::{self, SerialCircuit}; +use tket_json_rs::optype; +use tket_json_rs::register; +use tket_json_rs::register::{ElementId, Qubit}; const EMPTY_CIRCUIT: &str = r#"{ "phase": "0", @@ -250,10 +251,16 @@ fn circ_preset_qubits() -> Circuit { let mut hugr = h.finish_hugr_with_outputs([qb0, qb1]).unwrap(); // A preset register for the first qubit output - hugr.set_metadata( + hugr.set_metadata::( hugr.entrypoint(), - METADATA_Q_REGISTERS, - serde_json::json!([["q", [2]], ["q", [10]], ["q", [8]]]), + vec![ + ElementId(String::from("q"), vec![2]), + ElementId(String::from("q"), vec![10]), + ElementId(String::from("q"), vec![8]), + ] + .into_iter() + .map(Qubit::from) + .collect_vec(), ); hugr.into() @@ -284,10 +291,9 @@ fn circ_parameterized() -> Circuit { let mut hugr = h.finish_hugr_with_outputs([q]).unwrap(); // Preset names for some of the inputs - hugr.set_metadata( + hugr.set_metadata::( hugr.entrypoint(), - METADATA_INPUT_PARAMETERS, - serde_json::json!(["alpha", "beta"]), + vec![String::from("alpha"), String::from("beta")], ); hugr.into()